diff --git a/.github/workflows/assign-asset-label.yml b/.github/workflows/assign-asset-label.yml index b03f142c56a7..f4b9ac5c473b 100644 --- a/.github/workflows/assign-asset-label.yml +++ b/.github/workflows/assign-asset-label.yml @@ -1,6 +1,6 @@ name: '[Support] Assign asset label' on: - pull_request_target: + pull_request: types: - opened permissions: @@ -29,7 +29,7 @@ jobs: echo "name=NONE" >> $GITHUB_OUTPUT else echo "result=ok" >> $GITHUB_OUTPUT - echo "message=Adding label '${assets}'" >> $GITHUB_OUTPUT + echo "message=Adding label '${assets}'" >> $GITHUB_OUTPUT echo "name=${assets}" >> $GITHUB_OUTPUT fi - name: Show messages diff --git a/.github/workflows/comments.yml b/.github/workflows/comments.yml index 40fdfeab3a39..347923c6bc20 100644 --- a/.github/workflows/comments.yml +++ b/.github/workflows/comments.yml @@ -4,9 +4,10 @@ on: types: - created permissions: + contents: read repository-projects: write - issues: write - pull-requests: write + issues: read + pull-requests: read # Avoid concurrency over the same issue concurrency: group: card-movement-${{ github.event.issue.number }} diff --git a/.github/workflows/moving-cards.yml b/.github/workflows/moving-cards.yml index 889a38cc9bd5..c07e499da92d 100644 --- a/.github/workflows/moving-cards.yml +++ b/.github/workflows/moving-cards.yml @@ -6,6 +6,7 @@ on: - created - moved permissions: + contents: read issues: write pull-requests: write jobs: @@ -140,4 +141,4 @@ jobs: removePreviousAssignees: true teams: ${{ env.SUPPORT_TEAM_NAME }} repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }} - allowSelfAssign: false \ No newline at end of file + allowSelfAssign: false diff --git a/.github/workflows/pr-reviews.yml b/.github/workflows/pr-reviews.yml index 9f69125a3371..061256c783ab 100644 --- a/.github/workflows/pr-reviews.yml +++ b/.github/workflows/pr-reviews.yml @@ -1,11 +1,14 @@ name: '[Support] Review based card movements' on: - pull_request_target: + pull_request: types: - review_requested - synchronize permissions: repository-projects: write + contents: read + issues: read + pull-requests: read concurrency: group: card-movement-${{ github.event.number }} jobs: @@ -19,7 +22,19 @@ jobs: github.actor != 'bitnami-bot' && github.event.pull_request.user.login != 'bitnami-bot' && (!contains(github.event.pull_request.labels.*.name, 'bitnami')) && (!contains(github.event.pull_request.labels.*.name, 'triage')) steps: + - name: Repo checkout + uses: actions/checkout@v3 + with: + # Checkout from base to try to get latest information from the main branch. + ref: ${{ github.event.pull_request.base.ref }} + repository: ${{ github.event.pull_request.base.repo.full_name }} + - name: Load .env file + uses: xom9ikk/dotenv@v2 + with: + path: .github/workflows/ - name: Move into In Progress + # Move the card only if the actor is not a Bitnami member + if: ${{ !contains(fromJson(env.BITNAMI_TEAM), github.actor) }} uses: peter-evans/create-or-update-project-card@v2 with: project-name: Support diff --git a/.github/workflows/sync-teams.yml b/.github/workflows/sync-teams.yml index d7a1a95405bb..eb00dac80b06 100644 --- a/.github/workflows/sync-teams.yml +++ b/.github/workflows/sync-teams.yml @@ -4,8 +4,8 @@ on: # Daily - cron: '0 5 * * *' permissions: - repository-projects: write - + # All write actions are executed with BITNAMI_BOT + contents: write jobs: sync-support-teams: runs-on: ubuntu-latest @@ -32,7 +32,7 @@ jobs: sed -i "s|BITNAMI_TEAM=.*$|BITNAMI_TEAM='${TEAM_MEMBERS}'|g" .github/workflows/.env git config user.name "bitnami-bot" git config user.email "bitnami-bot@vmware.com" - git commit -s -m"[bitnami-bot] Updating Bitnami team members" .github/workflows/.env + git commit -s -m"[bitnami-bot] Updating Bitnami team members" .github/workflows/.env git push else echo "BITNAMI_TEAM is updated and nothing should be done" diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index d9952cde23c4..cf6856c01ae6 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -10,6 +10,8 @@ on: - reopened - opened permissions: + # Please note that projects cards are created/moved with Bitnami Bot (that's reason to use pull_request_target) + contents: read issues: write pull-requests: write # Avoid concurrency over the same issue