From 8c1cf5f852463590cc6f980ad44d017d764f7583 Mon Sep 17 00:00:00 2001 From: iamwatchdogs Date: Fri, 18 Oct 2024 16:54:26 +0530 Subject: [PATCH] Updated workflows fixed the permission and proper events, this events changes might led to security concerns. But for as of now, this might resolve the issue of workflow not working properly for the PRs made from forked repos. --- .github/workflows/auto-assigner.yml | 6 ++++++ .github/workflows/auto-commentor.yml | 12 ++++++------ .github/workflows/auto-labeler.yml | 7 +++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-assigner.yml b/.github/workflows/auto-assigner.yml index 7c6c608..d78b86f 100644 --- a/.github/workflows/auto-assigner.yml +++ b/.github/workflows/auto-assigner.yml @@ -3,9 +3,15 @@ name: Auto Assign on: pull_request: types: [opened, ready_for_review] + pull_request_target: + types: [opened, ready_for_review] issues: types: [opened] +permissions: + issues: write + pull-requests: write + jobs: auto-assign: runs-on: ubuntu-latest diff --git a/.github/workflows/auto-commentor.yml b/.github/workflows/auto-commentor.yml index f5415c5..63a99a3 100644 --- a/.github/workflows/auto-commentor.yml +++ b/.github/workflows/auto-commentor.yml @@ -2,8 +2,9 @@ name: Auto-commenter on: pull_request: - branches: [main] - types: [closed] + types: [opened, closed] + pull_request_target: + types: [opened, closed] permissions: id-token: write @@ -17,14 +18,13 @@ jobs: - uses: wow-actions/auto-comment@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pullRequestOpened: | 👋 @{{ author }} Thank you for raising your pull request. Please make sure you have followed our contributing guidelines. We will review it as soon as possible. - pullRequestClosed: > - 👋 @{{ author }} This PR is closed. If you think there's been a mistake, please contact with the maintainer @iamwatchdogs. + pullRequestClosed: | + 👋 @{{ author }} This PR is closed. If you think there's been a mistake, please contact the maintainer @iamwatchdogs. pullRequestMerged: | - Thank you for contributing @{{ author }}, Make sure to check your contribution on [GitHub Pages](grow-with-open-source.github.io/Notebook/ "view contributions"). + Thank you for contributing @{{ author }}. Make sure to check your contribution on [GitHub Pages](https://grow-with-open-source.github.io/Notebook/ "view contributions"). \ No newline at end of file diff --git a/.github/workflows/auto-labeler.yml b/.github/workflows/auto-labeler.yml index 7b38273..062f886 100644 --- a/.github/workflows/auto-labeler.yml +++ b/.github/workflows/auto-labeler.yml @@ -3,6 +3,13 @@ name: hacktoberfest-labeler on: pull_request: types: [opened, reopened, closed] + pull_request_target: + types: [opened, reopened, closed] + + +permissions: + contents: read + pull-requests: write jobs: auto-labeler: