Skip to content

chore: Replace personal access token with GitHub App Token (#508) #60

chore: Replace personal access token with GitHub App Token (#508)

chore: Replace personal access token with GitHub App Token (#508) #60

name: Publish to npm
on:
push:
branches: [ master ]
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.author.email, '[email protected]') }}
steps:
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Identify
run: |
git config user.name OpenActive Bot
git config user.email [email protected]
- name: Use Node.js 18.17.1
uses: actions/setup-node@v1
with:
node-version: 18.17.1
registry-url: https://registry.npmjs.org/
- name: Install
run: npm install
- name: Test
run: npm test
- name: Increment Version
run: npm version patch
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Push version update
run: git push
dispatch:
needs: publish
strategy:
matrix:
repo: ['data-model-validator-site', 'openactive-test-suite']
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Trigger tooling update
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ steps.generate-token.outputs.token }}
repository: openactive/${{ matrix.repo }}
event-type: data-model-validator-update