GHA Runners: Move Projects to OCI #138
This file contains hidden or 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
name: Auto Label Issues and PRs | |
on: | |
issue_comment: | |
types: [created, edited] | |
pull_request_target: | |
types: [opened, edited, reopened] | |
issues: | |
types: [opened, edited, reopened] | |
jobs: | |
label: | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Display PR number | |
if: ${{ github.event.pull_request }} | |
run: echo "This pull request is ${{ github.event.pull_request.number }} | ${{ github.event.pull_request.body }}" | |
- name: Display Issue number | |
if: ${{ !github.event.pull_request }} | |
run: echo "This issue is ${{ github.event.issue.number }} | ${{ github.event.issue.body}}" | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c | |
with: | |
separator: "," | |
- name: Display files | |
if: ${{ github.event.pull_request }} | |
run: echo "Changed files ${{ steps.changed-files.outputs.all_changed_files }}" | |
- name: Run labeler action for PR | |
if: ${{ github.event.pull_request }} | |
uses: ./.github/actions/labeler-action | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
labels: https://raw.githubusercontent.com/mrbobbytables/cncf-automation/refs/heads/label-config/utilities/labeler/labels.yaml | |
owner: ${{ github.repository_owner }} | |
repo: ${{ github.event.repository.name }} | |
issue_number: ${{ github.event.pull_request.number }} | |
comment_body: ${{ github.event.pull_request.body }} | |
changed_files: ${{ steps.changed-files.outputs.all_changed_files }} | |
- name: Run labeler action for Issue | |
if: ${{ !github.event.pull_request }} | |
uses: ./.github/actions/labeler-action | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
labels: https://raw.githubusercontent.com/mrbobbytables/cncf-automation/refs/heads/label-config/utilities/labeler/labels.yaml | |
owner: ${{ github.repository_owner }} | |
repo: ${{ github.event.repository.name }} | |
issue_number: ${{ github.event.issue.number }} | |
comment_body: ${{ github.event.comment.body }} |