Skip to content

Commit

Permalink
Automatically add PRs to Rikolti MVP Project
Browse files Browse the repository at this point in the history
  • Loading branch information
amywieliczka committed Mar 19, 2024
1 parent e63d778 commit b68eff9
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/project_add_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Add PRs to Rikolti MVP Project

on:
pull_request:
types:
- opened
- reopened
- labeled

jobs:
add-to-project:
name: Add PR to Rikolti MVP Project
runs-on: ubuntu-latest
steps:
- name: Add To GitHub projects
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/ucldc/projects/1
github-token: ${{ secrets.AMY_ADD_TO_PROJECT_TOKEN }}
id: add-project
- name: Get Current Sprint ID
env:
GITHUB_TOKEN: ${{ secrets.AMY_ADD_TO_PROJECT_TOKEN }}
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
field(name: "Sprint") {
... on ProjectV2IterationField {
id
name
configuration {
completedIterations {
id
title
startDate
}
iterations {
id
title
startDate
}
}
}
}
}
}
}' -f org=ucldc -F number=1 > sprint_data.json
CURRENT_SPRINT=$(jq -r '
.data.organization.projectV2.field.configuration.iterations
| sort_by(.startDate)
| .[0].id' sprint_data.json)
echo "CURRENT_SPRINT=$CURRENT_SPRINT" >> $GITHUB_ENV
- name: Check env
run: echo $SPRINT_ID
- name: Update Project Fields
uses: titoportas/update-project-fields@v0.1.0
with:
project-url: https://github.com/orgs/ucldc/projects/1
github-token: ${{ secrets.AMY_ADD_TO_PROJECT_TOKEN }}
item-id: ${{ steps.add-project.outputs.itemId }}
field-keys: Sprint
field-values: ${{ env.SPRINT_ID }}



0 comments on commit b68eff9

Please sign in to comment.