Skip to content

WasteAndMaterialFootprint - presubmission enquiry #73

WasteAndMaterialFootprint - presubmission enquiry

WasteAndMaterialFootprint - presubmission enquiry #73

name: update-project
on:
issues:
types:
- labeled
jobs:
update-issue-column:
runs-on: ubuntu-latest
permissions:
repository-projects: write
steps:
- uses: actions/checkout@v4
- name: Get column ID
id: get-column
run: |
value=$(jq -r .labelToColumnId.\"${{ github.event.label.name }}\" update-project.json)
echo "id=$value" >>$GITHUB_OUTPUT
echo "Label: ${{ github.event.label.name }}"
echo "Column id: $value"
- name: Add issue to project
if: ${{ steps.get-column.outputs.id != 'null' }}
id: add-to-project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/pyOpenSci/projects/7
github-token: ${{ secrets.GHPROJECT_TOKEN }}
- name: Move issue to column
if: ${{ steps.get-column.outputs.id != 'null' }}
uses: octokit/[email protected]
with:
query: |
mutation($project: ID!, $item: ID!, $field: ID!, $column: String!) {
updateProjectV2ItemFieldValue(
input: {
projectId: $project
itemId: $item
fieldId: $field
value: {
singleSelectOptionId: $column
}
}
) {
projectV2Item {
id
}
}
}
variables: |
project: "PVT_kwDOAbmP7s4ASqjL"
item: ${{ steps.add-to-project.outputs.itemId }}
field: "PVTSSF_lADOAbmP7s4ASqjLzgL66FI"
column: ${{ steps.get-column.outputs.id }}
env:
GITHUB_TOKEN: ${{ secrets.GHPROJECT_TOKEN }}