Skip to content

@PR • Labeler triggered by ofreyssinet-ledger on branch feature/protect-3391-3392-3393-3401-3403 #38237

@PR • Labeler triggered by ofreyssinet-ledger on branch feature/protect-3391-3392-3393-3401-3403

@PR • Labeler triggered by ofreyssinet-ledger on branch feature/protect-3391-3392-3393-3401-3403 #38237

Workflow file for this run

name: "@PR • Labeler"
run-name: "@PR • Labeler triggered by ${{ github.actor }} ${{ format('on branch {0}', github.head_ref) }}"
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-22.04
steps:
- name: generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_BOT_APP_ID }}
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- uses: actions/labeler@v4
with:
repo-token: ${{ steps.generate-token.outputs.token }}
- uses: actions/github-script@v7
if: github.event.pull_request.head.repo.fork
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
try {
const { data: rawLabels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
}) || [];
const labels = rawLabels.map(label => label.name)
console.log(labels)
if(labels.includes('fork')) {
return
}
await github.rest.issues.setLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: [...labels, 'fork']
})
} catch(error) {
console.error(error)
}