Skip to content

gh-project-integration-processor #507

gh-project-integration-processor

gh-project-integration-processor #507

name: gh-project-integration-processor
on:
# Trigger when the PR workflow completes
workflow_run:
workflows: [gh-project-integration]
types:
- completed
jobs:
rancher_gh_project:
permissions:
actions: read
issues: write
pull-requests: write
repository-projects: write
id-token: write
if: ${{ github.repository_owner == 'rancher' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Use Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: '.nvmrc'
- name: Read secrets
uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | APP_PEM
- name: Generate Token
id: generate-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.APP_PEM }}
- name: Download artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: pr-gh-project-event
path: pr-gh-project-event/
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- name: script
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
PR_PROJECT: ${{ secrets.PR_PROJECT }}
GITHUB_EVENT_PATH: pr-gh-project-event/event.json
run: node .github/workflows/scripts/pr-gh-project.js