Skip to content

Update supporting Kubernetes (1.28) #62

Update supporting Kubernetes (1.28)

Update supporting Kubernetes (1.28) #62

Workflow file for this run

name: Add a new item to project
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
jobs:
add_item:
runs-on: ubuntu-latest
steps:
- name: Issue an access token
uses: cybozu/octoken-action@v1
id: create-iat
with:
github_app_id: ${{ secrets.PROJECT_APP_ID }}
github_app_private_key: ${{ secrets.PROJECT_APP_PEM }}
- name: Get project data
env:
GITHUB_TOKEN: ${{ steps.create-iat.outputs.token }}
ORGANIZATION: topolvm
PROJECT_NUMBER: "2"
run: |
proj_id="$(gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
}
}
}' -F org=$ORGANIZATION -F number=$PROJECT_NUMBER --jq '.data.organization.projectV2.id')"
echo "PROJECT_ID=${proj_id}" >> $GITHUB_ENV
- name: Add an item to project
env:
GITHUB_TOKEN: ${{ steps.create-iat.outputs.token }}
run: |
if [ ${{ github.event_name }} = issues ]; then
CONTENT_ID=${{ github.event.issue.node_id }}
else
CONTENT_ID=${{ github.event.pull_request.node_id }}
fi
gh api graphql -f query='
mutation($project:ID!, $contentId:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $contentId}) {
item {
id
}
}
}' -F project=$PROJECT_ID -F contentId=$CONTENT_ID --jq '.data.addProjectV2ItemById.item.id'