Skip to content

Commit

Permalink
chore: Removes actions-permissions step and set minimal permissions f…
Browse files Browse the repository at this point in the history
…or workflows that have run (#2286)
  • Loading branch information
oarbusi authored May 17, 2024
1 parent bc75bcb commit 53069bc
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 47 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ jobs:

get-provider-version:
runs-on: ubuntu-latest
permissions: {}
outputs:
provider_version: ${{ inputs.provider_version || steps.get_last_release.outputs.last_provider_version }}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Get Last Release
Expand All @@ -136,6 +136,7 @@ jobs:
change-detection:
runs-on: ubuntu-latest
permissions: {}
env:
mustTrigger: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.test_group == '') }}
outputs:
Expand All @@ -159,7 +160,6 @@ jobs:
serverless: ${{ steps.filter.outputs.serverless == 'true' || env.mustTrigger == 'true' }}
stream: ${{ steps.filter.outputs.stream == 'true' || env.mustTrigger == 'true' }}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
Expand Down Expand Up @@ -246,8 +246,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.advanced_cluster == 'true' || inputs.test_group == 'advanced_cluster' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -268,8 +268,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.assume_role == 'true' || inputs.test_group == 'assume_role' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -308,8 +308,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.backup == 'true' || inputs.test_group == 'backup' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -341,8 +341,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.cluster == 'true' || inputs.test_group == 'cluster' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -365,8 +365,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.cluster_outage_simulation == 'true' || inputs.test_group == 'cluster_outage_simulation' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -387,8 +387,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.config == 'true' || inputs.test_group == 'config' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -432,8 +432,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.data_lake == 'true' || inputs.test_group == 'data_lake' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -454,8 +454,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.encryption == 'true' || inputs.test_group == 'encryption' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -476,8 +476,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.event_trigger == 'true' || inputs.test_group == 'event_trigger' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -498,8 +498,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.federated == 'true' || inputs.test_group == 'federated' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -536,8 +536,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -563,8 +563,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.ldap == 'true' || inputs.test_group == 'ldap' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -592,8 +592,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.network == 'true' || inputs.test_group == 'network' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -630,8 +630,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.project == 'true' || inputs.test_group == 'project' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down Expand Up @@ -666,8 +666,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.push_based_log_export == 'true' || inputs.test_group == 'push_based_log_export' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -691,8 +691,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.search_deployment == 'true' || inputs.test_group == 'search_deployment' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -713,8 +713,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.search_index == 'true' || inputs.test_group == 'search_index' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -735,8 +735,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.serverless == 'true' || inputs.test_group == 'serverless' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand All @@ -762,8 +762,8 @@ jobs:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.stream == 'true' || inputs.test_group == 'stream' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
ref: ${{ inputs.ref || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-changelog-entry-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-migration-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
check:
if: ${{ contains(github.event.pull_request.title, '!') }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cleanup-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
jobs:
cleanup-test-env-general:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
Expand All @@ -26,8 +26,8 @@ jobs:
run: ./scripts/cleanup-test-env.sh
cleanup-test-env-qa:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
Expand All @@ -29,7 +29,6 @@ jobs:
permissions:
pull-requests: write # Needed by sticky-pull-request-comment
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
Expand All @@ -38,8 +37,8 @@ jobs:
run: make test
lint:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Install Go
Expand All @@ -56,8 +55,8 @@ jobs:
shell: bash
website-lint:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
Expand All @@ -66,8 +65,8 @@ jobs:
run: make tools && make website-lint
shellcheck:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Run ShellCheck
uses: bewuethr/shellcheck-action@d01912909579c4b1a335828b8fca197fbb8e0aa4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
fail-fast: false
matrix:
terraform_version: ["${{vars.TF_VERSION_LATEST}}"]
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
fetch-depth: 0
Expand Down Expand Up @@ -57,8 +57,8 @@ jobs:
fail-fast: false
matrix:
terraform_version: ["${{vars.TF_VERSION_LATEST}}"]
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
needs: [generate-and-update-changelog]
if: ${{ !cancelled() && needs.generate-and-update-changelog.result == 'failure' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
name: Create Jira issue
if: github.event.action == 'opened'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Create JIRA ticket
id: create
shell: bash
Expand Down Expand Up @@ -73,8 +74,8 @@
name: Reopen JIRA ticket
if: github.event.action == 'reopened'
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Reopened JIRA ticket if exists
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
Expand Down Expand Up @@ -123,7 +124,6 @@
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Close JIRA ticket if exists
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notify-docs-team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.changes.outputs.files }}
permissions:
pull-requests: read
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: changes
Expand All @@ -28,7 +29,6 @@ jobs:
permissions:
pull-requests: write # Needed by sticky-pull-request-comment
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DOCS }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pull-request-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
permissions:
pull-requests: write # Needed by sticky-pull-request-comment
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: amannn/action-semantic-pull-request@cfb60706e18bc85e8aec535e3c577abe8f70378e
id: lint_pr_title
env:
Expand Down Expand Up @@ -76,7 +75,6 @@ jobs:
contents: read
pull-requests: write # Needed by labeler
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: srvaroa/labeler@1eec6d9e7c5fa5864840279978680302f955fc37
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading

0 comments on commit 53069bc

Please sign in to comment.