From 8744f777adfe2fc2c4f3f1f9e419f5596417a6d0 Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Thu, 18 May 2023 19:22:19 +0200 Subject: [PATCH] Update workflows environments (#2657) * Update workflows environments * PAT for dev envs --- .github/workflows/auto-update-linters.yml | 4 +++- .github/workflows/deploy-BETA-flavors.yml | 2 +- .github/workflows/deploy-BETA-linters.yml | 2 ++ .github/workflows/deploy-RELEASE-flavors.yml | 2 +- .github/workflows/deploy-RELEASE-linters.yml | 2 ++ .github/workflows/deploy-RELEASE.yml | 2 +- .github/workflows/mega-linter-for-runner.yml | 6 ++++-- .github/workflows/mega-linter.yml | 6 ++++-- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-update-linters.yml b/.github/workflows/auto-update-linters.yml index e9a130ff44f..29daf865fa3 100644 --- a/.github/workflows/auto-update-linters.yml +++ b/.github/workflows/auto-update-linters.yml @@ -31,6 +31,8 @@ jobs: contents: write issues: write pull-requests: write + environment: + name: auto-update # Prevent duplicate run from happening when a forked push is committed if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && github.repository == 'oxsecurity/megalinter' # Set max build time for the job @@ -111,7 +113,7 @@ jobs: if: steps.compute_versions.outputs.has_updated_versions == 1 uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} author: "Nicolas Vuillamy " commit-message: "[automation] Auto-update linters version, help and documentation" delete-branch: true diff --git a/.github/workflows/deploy-BETA-flavors.yml b/.github/workflows/deploy-BETA-flavors.yml index 885f359f550..2e833bb83ed 100644 --- a/.github/workflows/deploy-BETA-flavors.yml +++ b/.github/workflows/deploy-BETA-flavors.yml @@ -45,7 +45,7 @@ jobs: # Set the agent to run on runs-on: ${{ matrix.os }} environment: - name: beta-flavors + name: beta strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/deploy-BETA-linters.yml b/.github/workflows/deploy-BETA-linters.yml index c8ab5aa643c..61252fa5bf9 100644 --- a/.github/workflows/deploy-BETA-linters.yml +++ b/.github/workflows/deploy-BETA-linters.yml @@ -63,6 +63,8 @@ jobs: runs-on: ${{ matrix.os }} permissions: packages: write + environment: + name: beta strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/deploy-RELEASE-flavors.yml b/.github/workflows/deploy-RELEASE-flavors.yml index a5f71d475f0..27e3263f3cd 100644 --- a/.github/workflows/deploy-RELEASE-flavors.yml +++ b/.github/workflows/deploy-RELEASE-flavors.yml @@ -35,7 +35,7 @@ jobs: # Set the agent to run on runs-on: ${{ matrix.os }} environment: - name: latest-flavors + name: release strategy: fail-fast: false matrix: diff --git a/.github/workflows/deploy-RELEASE-linters.yml b/.github/workflows/deploy-RELEASE-linters.yml index fb4b011aa3f..66dfffe40e4 100644 --- a/.github/workflows/deploy-RELEASE-linters.yml +++ b/.github/workflows/deploy-RELEASE-linters.yml @@ -39,6 +39,8 @@ jobs: runs-on: ${{ matrix.os }} permissions: packages: write + environment: + name: release strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index d691505998d..dd09a6a1170 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -38,7 +38,7 @@ jobs: # Only run on main repo if: github.repository == 'oxsecurity/megalinter' && !contains(github.event.head_commit.message, 'skip deploy') environment: - name: latest + name: release ################## # Load all steps # ################## diff --git a/.github/workflows/mega-linter-for-runner.yml b/.github/workflows/mega-linter-for-runner.yml index 51f4ac3d077..49600e2fec6 100644 --- a/.github/workflows/mega-linter-for-runner.yml +++ b/.github/workflows/mega-linter-for-runner.yml @@ -30,11 +30,13 @@ jobs: contents: write issues: write pull-requests: write + environment: + name: dev steps: - name: Checkout Code uses: actions/checkout@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: 0 # MegaLinter @@ -67,7 +69,7 @@ jobs: if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" title: "[MegaLinter] Apply linters automatic fixes" labels: bot diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 01dd83497ad..1555efd4ae2 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -30,11 +30,13 @@ jobs: contents: write issues: write pull-requests: write + environment: + name: dev steps: - name: Checkout Code uses: actions/checkout@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: 0 # MegaLinter @@ -67,7 +69,7 @@ jobs: if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" title: "[MegaLinter] Apply linters automatic fixes" labels: bot