# Requires repo secret: PERSONAL_ACCESS_TOKEN with permissions: # Administration: read and write name: GitHub Repository Update on: push: branches: - 'main' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: repo-update: permissions: repository-projects: write runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - run: | DATA=$(jq --raw-output --compact-output '{description: .description, homepage: .homepage}' package.json) curl \ --fail-with-body \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${PERSONAL_ACCESS_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/${GITHUB_REPOSITORY}" \ -d "${DATA}" env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - run: | DATA=$(jq --raw-output --compact-output '{names: .keywords}' package.json) curl \ --fail-with-body \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${PERSONAL_ACCESS_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/${GITHUB_REPOSITORY}/topics" \ -d "${DATA}" env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}