@@ -13,56 +13,15 @@ jobs:
1313 if : github.repository == 'github/docs-internal'
1414 runs-on : ubuntu-latest
1515 steps :
16- - id : find_project_cards
17- uses : octokit/graphql-action@5b3e01d42dee4509b0ac6b1cb2cf7778cdce85c2
18- with :
19- query : |
20- query($issue_node_id:ID!) {
21- node(id:$issue_node_id) {
22- ... on Issue {
23- projectCards(first: 10) {
24- nodes {
25- id
26- project {
27- name
28- id
29- }
30- }
31- }
32- }
33- ... on PullRequest {
34- projectCards(first: 10) {
35- nodes {
36- id
37- project {
38- name
39- id
40- }
41- }
42- }
43- }
44- }
45- }
46- issue_node_id : ${{ github.event.client_payload.command.resource.id }}
16+ - name : Remove issue from board
17+ if : ${{ github.event.client_payload.command.resource.type == 'Issue' }}
18+ run : gh issue edit "$ISSUE_URL" --remove-project "Docs content first responder"
4719 env :
48- GITHUB_TOKEN : ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
49-
50- - run : " echo 'Project cards found: ${{ steps.find_project_cards.outputs.data }}'"
51-
52- - name : Get FR card
53- env :
54- QUERY_DATA : ${{ steps.find_project_cards.outputs.data }}
55- run : |
56- echo 'FR_CARDS='$(jq '.node.projectCards.nodes | .[] | select(.project.id == "MDc6UHJvamVjdDQ1NzI0ODI=") | .id' <<< "$QUERY_DATA") >> $GITHUB_ENV
57-
58- - name : Delete card
59- id : delete_project_card
60- if : ${{ env.FR_CARDS }}
61- uses : octokit/graphql-action@5b3e01d42dee4509b0ac6b1cb2cf7778cdce85c2
62- with :
63- query : |
64- mutation DeleteCard {
65- deleteProjectCard(input:{cardId:${{ env.FR_CARDS }}}) {deletedCardId}
66- }
20+ GITHUB_TOKEN : ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
21+ ISSUE_URL : https://github.com/${{ github.event.client_payload.command.repository.full_name }}/issues/${{ github.event.client_payload.command.resource.number }}
22+ - name : Remove PR from board
23+ if : ${{ github.event.client_payload.command.resource.type == 'PullRequest' }}
24+ run : gh pr edit "$PR_URL" --remove-project "Docs content first responder"
6725 env :
68- GITHUB_TOKEN : ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
26+ GITHUB_TOKEN : ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
27+ PR_URL : https://github.com/${{ github.event.client_payload.command.repository.full_name }}/pull/${{ github.event.client_payload.command.resource.number }}
0 commit comments