Skip to content

fix/re-add dropped labels (#11738) #74

fix/re-add dropped labels (#11738)

fix/re-add dropped labels (#11738) #74

Workflow file for this run

name: meta(labels)
on:
pull_request:
paths:
- .github/labels.yml
push:
branches:
- master
paths:
- .github/labels.yml
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
jobs:
sync:
name: syncs repository labels
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
id: setup-node
with:
node-version-file: 'package.json'
- name: Install github-label-sync
run: yarn global add [email protected]
- name: Run github-label-sync
run: |
github-label-sync \
--access-token ${{ secrets.GITHUB_TOKEN }} \
--labels .github/labels.yml \
${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \
${{ github.repository }} \
2>&1 | tee sync-report.txt
- name: Read sync output into variable
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: github.event_name == 'pull_request'
id: github-label-sync
with:
script: |
const fs = require('fs');
return fs.readFileSync('sync-report.txt','utf8').toString();
result-encoding: string
- name: Find previous dry-run comment
uses: peter-evans/find-comment@d5fe37641ad8451bdd80312415672ba26c86575e
if: github.event_name == 'pull_request'
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- LABELS_UPDATE -->'
- name: Add or update dry-run comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
if: github.event_name == 'pull_request'
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: >
<!-- LABELS_UPDATE -->
🏷 The following changes will be made to the repository labels
```
${{ steps.github-label-sync.outputs.result }}
```