-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bitnami/containers] Revisit workflow permissions (#36685)
* [bitnami/containers] Revisit workflow permissions Signed-off-by: Fran Mulero <[email protected]> * Apply suggestions Signed-off-by: Fran Mulero <[email protected]> --------- Signed-off-by: Fran Mulero <[email protected]>
- Loading branch information
Showing
16 changed files
with
97 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,26 @@ on: | |
- main | ||
paths: | ||
- '**.md' | ||
permissions: | ||
contents: read | ||
# Remove all permissions by default | ||
permissions: {} | ||
jobs: | ||
markdown-linter: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Install mardownlint | ||
run: npm install -g [email protected] | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
- name: Execute markdownlint | ||
env: | ||
DIFF_URL: "${{github.event.pull_request.diff_url}}" | ||
TEMP_FILE: "${{runner.temp}}/pr-${{github.event.number}}.diff" | ||
run: | | ||
# Using the Github API to detect the files changed as git merge-base stops working when the branch is behind | ||
# and jitterbit/get-changed-files does not support pull_request_target | ||
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | ||
files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL") | ||
files_changed="$(echo "$files_changed_data" | jq -r '.[] | .filename')" | ||
# This request doesn't consume API calls. | ||
curl -Lkso $TEMP_FILE $DIFF_URL | ||
files_changed="$(sed -nr 's/[\-\+]{3} [ab]\/(.*)/\1/p' $TEMP_FILE | sort | uniq)" | ||
md_files="$(echo "$files_changed" | grep -o ".*\.md$" | sort | uniq || true)" | ||
# Create an empty file, useful when the PR changes ignored files | ||
touch ${{runner.temp}}/output | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ on: | |
workflow_dispatch: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
# Remove all permissions by default | ||
permissions: {} | ||
# This job won't trigger any additional event. All actions are performed with GITHUB_TOKEN | ||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
# This step will add the stale comment and label for the first 15 days without activity. It won't close any task | ||
- uses: actions/[email protected] | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
name: '[Support] Synchronize labels from the vms repository' | ||
name: '[Support] Synchronize labels from the containers repository' | ||
on: | ||
schedule: | ||
# Daily | ||
- cron: '0 3 * * *' | ||
permissions: | ||
issues: write | ||
|
||
# Remove all permissions by default | ||
permissions: {} | ||
jobs: | ||
sync-labels: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- uses: EndBug/label-sync@v2 | ||
with: | ||
source-repo: bitnami/vms | ||
source-repo: bitnami/containers | ||
delete-other-labels: false | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Oops, something went wrong.