Skip to content

Label PR based on title #302

Label PR based on title

Label PR based on title #302

name: Label PR based on title
on:
workflow_run:
workflows: ["Record PR details"]
types:
- completed
permissions:
pull-requests: write
jobs:
get_pr_details:

Check failure on line 13 in .github/workflows/label_pr_on_title.yml

View workflow run for this annotation

GitHub Actions / Label PR based on title

Invalid workflow file

The workflow is not valid. .github/workflows/label_pr_on_title.yml (Line: 13, Col: 3): Error calling workflow 'aws-samples/aws-serverless-developer-experience-workshop-python/.github/workflows/reusable_export_pr_details.yml@418b3d0d024c7cb6feaa746a4c42f00ec387baa4'. The workflow is requesting 'contents: read', but is only allowed 'contents: none'. .github/workflows/label_pr_on_title.yml (Line: 13, Col: 3): Error calling workflow 'aws-samples/aws-serverless-developer-experience-workshop-python/.github/workflows/reusable_export_pr_details.yml@418b3d0d024c7cb6feaa746a4c42f00ec387baa4'. The nested job 'export_pr_details' is requesting 'actions: read', but is only allowed 'actions: none'.
# Guardrails to only ever run if PR recording workflow was indeed
# run in a PR event and ran successfully
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
label_pr:
needs: get_pr_details
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: "Label PR based on title"
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# This safely runs in our base repo, not on fork
# thus allowing us to provide a write access token to label based on PR title
# and label PR based on semantic title accordingly
script: |
const script = require('.github/scripts/label_pr_based_on_title.js')
await script({github, context, core})