Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed Dec 14, 2023
1 parent 4fcd032 commit f2a8954
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/issues-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,23 @@ jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
env:
BOARD_NAME: "Kuadrant"
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
NUMBER: ${{ github.event.number }}
steps:
- name: Check if issue is already in Project Kuadrant
run: |
if curl -i -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query ($pr: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pr) { projectItems(first: 20) { nodes { project { title } } } } } }", "variables" : "{ \"pr\": '${PR}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql | grep ""; then
echo "Issue is already in Project '$BOARD_NAME', cancelling this workflow";
echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV
else
echo "Issue is not in project '$BOARD_NAME', adding it to $BOARD_NAME, if this step fails please have it added by someone from the Kuadrant org and rerun - ignore this failure until then."
echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV
fi
- uses: actions/[email protected]
if: ${{ env.ALREADY_IN_BOARD == 'false' }}
with:
project-url: https://github.com/orgs/Kuadrant/projects/18
github-token: ${{ secrets.ADD_ISSUES_TOKEN }}

0 comments on commit f2a8954

Please sign in to comment.