Enable to check verification error details on webhooks by users #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release AirOne APIv2 client npm package to GitHub npm Registry | |
on: | |
# use pull_request_target with labeled(repo owner's operation) to prevent leaking secrets | |
# see also https://pankona.github.io/blog/2021/03/29/github-actions-pull-request-target/ | |
pull_request_target: | |
types: [labeled] | |
paths: | |
- "**/api_v2/**/*.py" | |
- "apiclient/typescript-fetch/package.json" | |
- ".github/workflows/release-apiv2-client.yml" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
pull-requests: write | |
if: ${{ github.event.label.name == 'release-apiv2-client' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.5" | |
cache: "poetry" | |
- name: apt-get | |
run: | | |
sudo apt-get update | |
sudo apt-get install libldap2-dev libsasl2-dev libxmlsec1-dev libmysqlclient-dev pkg-config | |
- name: poetry install | |
run: | | |
poetry install --no-ansi | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@dmm-com" | |
- name: install dependencies | |
run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: generate client | |
run: | | |
poetry run npm run generate:client | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
working-directory: ./apiclient/typescript-fetch | |
- name: Find Comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: "github-actions[bot]" | |
body-includes: "<!-- release-apiv2-client-notification -->" | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
edit-mode: replace | |
body: | | |
<!-- release-apiv2-client-notification --> | |
:zap: :zap: :zap: Now the latest apiv2 client npm package is available at: | |
https://github.com/dmm-com/airone/pkgs/npm/airone-apiclient-typescript-fetch/versions |