diff --git a/.github/workflows/add-new-issues-to-project.yml b/.github/workflows/add-new-issues-to-project.yml deleted file mode 100644 index ec999f05b1a..00000000000 --- a/.github/workflows/add-new-issues-to-project.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Add new issues to PatternFly Issues project -on: - issues: - types: - - opened -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v1.0.2 - with: - project-url: https://github.com/orgs/patternfly/projects/7 - github-token: ${{ secrets.GH_PROJECTS }} - label-issue: - runs-on: ubuntu-latest - steps: - - name: Team Membership Checker - id: teamcheck - # You may pin to the exact commit or the version. - # uses: TheModdingInquisition/actions-team-membership@a69636a92bc927f32c3910baac06bacc949c984c - uses: TheModdingInquisition/actions-team-membership@v1.0 - with: - # Repository token. GitHub Action token is used by default(recommended). But you can also use the other token(e.g. personal access token). - token: ${{ secrets.GH_READ_ORG_TOKEN }} - # The team to check for. - team: 'frequent-flyers' - # The organization of the team to check for. Defaults to the context organization. - organization: 'patternfly' - # If the action should exit if the user is not part of the team. - exit: false - - - name: Add label if user is a team member - if: steps.teamcheck.outputs.permitted == 'true' - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels \ - -d '{"labels":["PF Team"]}' diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ba9dbe11555..e5f6866611f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,6 +1,8 @@ name: Documentation on: pull_request_target: + issue_comment: + types: [created] workflow_call: secrets: SURGE_LOGIN: @@ -10,17 +12,23 @@ on: GH_PR_TOKEN: required: true jobs: + check-permissions: + uses: patternfly/.github/.github/workflows/check-team-membership.yml@main + secrets: inherit + deploy: name: Build, test & deploy runs-on: ubuntu-latest + needs: check-permissions + if: github.event_name == 'workflow_call' || needs.check-permissions.outputs.allowed == 'true' env: SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} - GH_PR_NUM: ${{ github.event.number }} + GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }} steps: - name: Check out project from PR branch - if: github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' || github.event_name == 'issue_comment' uses: actions/checkout@v4 with: # Checkout the merge commit so that we can access the PR's changes. @@ -28,7 +36,7 @@ jobs: ref: refs/pull/${{ env.GH_PR_NUM }}/head - name: Check out project - if: github.event_name != 'pull_request_target' + if: github.event_name == 'workflow_call' uses: actions/checkout@v4 - name: Set up and build project diff --git a/.github/workflows/label-pf-team-issue.yml b/.github/workflows/label-pf-team-issue.yml new file mode 100644 index 00000000000..9019ee29bec --- /dev/null +++ b/.github/workflows/label-pf-team-issue.yml @@ -0,0 +1,9 @@ +name: Label PF Team issues +on: + issues: + types: + - opened +jobs: + label: + uses: patternfly/.github/.github/workflows/add-pf-team-label-workflow.yml@main + secrets: inherit