Log metrics #5
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
# A workflow to validate at least one release-note category is selected | |
name: release-note | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
- labeled | |
- unlabeled | |
# post-merge job requires write access to add a label and post a comment. | |
pull_request_target: | |
types: | |
- closed | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash --noprofile --norc -exo pipefail {0} | |
jobs: | |
validate-labeled: | |
if: github.event.pull_request.draft == false && github.event.action != 'closed' | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read # validateLabeled looks at PR's labels | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
.github | |
- name: validate-labeled | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
// https://github.com/actions/github-script#run-a-separate-file | |
const script = require("./.github/workflows/release-note.js"); | |
await script.validateLabeled({ core, context, github }); | |
post-merge: | |
if: github.event.action == 'closed' && github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
pull-requests: write # postMerge labels PRs | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
.github | |
- name: post-merge | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
// https://github.com/actions/github-script#run-a-separate-file | |
const script = require("./.github/workflows/release-note.js"); | |
await script.postMerge({ context, github }); |