Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #235

Closed
wants to merge 1 commit into from
Closed

WIP #235

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/issues-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,30 @@ on:
types:
- opened

permissions:
repository-projects: read

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) { projectsV2(first: 20) { nodes { title } } } } }", "variables" : "{ \"pr\": '${NUMBER}', \"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 }}
Loading