1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Update Actions examples in "Contexts" (#49585)

This commit is contained in:
Chad Fawcett
2024-03-07 14:10:46 -08:00
committed by GitHub
parent 68b6f71055
commit b22ad54425
2 changed files with 27 additions and 38 deletions

View File

@@ -1,17 +1,19 @@
This example workflow uses the [labeler action](https://github.com/actions/labeler), which requires the `GITHUB_TOKEN` as the value for the `repo-token` input parameter:
This example workflow uses the [GitHub CLI](/actions/using-workflows/using-github-cli-in-workflows), which requires the `GITHUB_TOKEN` as the value for the `GH_TOKEN` input parameter:
```yaml copy
name: Pull request labeler
on: [ pull_request_target ]
name: Open new issue
on: workflow_dispatch
jobs:
triage:
open-issue:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- uses: {% data reusables.actions.action-labeler %}
with:
repo-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
- run: |
gh issue --repo {% raw %}${{ github.repository }}{% endraw %} \
create --title "Issue title" --body "Issue body"
env:
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
```