diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 6b955e6a64..781fc7aa36 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -1,7 +1,11 @@ name: CI (PR) + on: pull_request: +permissions: + contents: read + jobs: code-analyses: uses: ./.github/workflows/code-analyses.yml diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish.yml index 35a5e5bb4a..7eb6d1eb7f 100644 --- a/.github/workflows/ci-publish.yml +++ b/.github/workflows/ci-publish.yml @@ -5,6 +5,9 @@ on: workflows: ["Mark commit as stable"] types: [completed] +permissions: + contents: read + jobs: publish: if: ${{ github.event.workflow_run.conclusion == 'success' }} diff --git a/.github/workflows/ci-push.yml b/.github/workflows/ci-push.yml index 26ecb8407e..30ac75d063 100644 --- a/.github/workflows/ci-push.yml +++ b/.github/workflows/ci-push.yml @@ -1,7 +1,11 @@ name: CI (push) + on: push: +permissions: + contents: read + jobs: code-analyses: uses: ./.github/workflows/code-analyses.yml diff --git a/.github/workflows/ci-schedule.yml b/.github/workflows/ci-schedule.yml index 5ef1135286..6bd58e612c 100644 --- a/.github/workflows/ci-schedule.yml +++ b/.github/workflows/ci-schedule.yml @@ -2,7 +2,11 @@ name: CI (Scheduled) on: schedule: - - cron: '33 10 * * 2' + - cron: "33 10 * * 2" + +permissions: + contents: read + jobs: ci-schedule: - uses: ./.github/workflows/code-analyses.yml \ No newline at end of file + uses: ./.github/workflows/code-analyses.yml diff --git a/.github/workflows/ci-version.yml b/.github/workflows/ci-version.yml index 79d8cb3c83..86c54a7df8 100644 --- a/.github/workflows/ci-version.yml +++ b/.github/workflows/ci-version.yml @@ -6,10 +6,15 @@ on: - main - master tags: - - 'v*' + - "v*" + +permissions: + contents: read + jobs: code-analyses: uses: ./.github/workflows/code-analyses.yml + ci-version: needs: - code-analyses @@ -19,14 +24,14 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') permissions: - contents: write # Required to move/update the tag + contents: write steps: - name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 0 - fetch-tags: true # We need all tags for version comparison + fetch-tags: true - name: Move 'stable' tag only if this version is the highest run: | @@ -52,9 +57,7 @@ jobs: echo "All version tags:" echo "${ALL_V_TAGS}" - # Determine highest version using natural version sorting LATEST_TAG="$(printf '%s\n' ${ALL_V_TAGS} | sort -V | tail -n1)" - echo "Highest version tag: ${LATEST_TAG}" if [[ "${VERSION}" != "${LATEST_TAG}" ]]; then @@ -66,11 +69,9 @@ jobs: echo "Current version ${VERSION} IS the highest version." echo "Updating 'stable' tag..." - # Delete existing stable tag (local + remote) git tag -d stable 2>/dev/null || true git push origin :refs/tags/stable || true - # Create new stable tag git tag stable "$GITHUB_SHA" git push origin stable diff --git a/.github/workflows/code-analyses.yml b/.github/workflows/code-analyses.yml index 564b9c3ef9..d3876395f2 100644 --- a/.github/workflows/code-analyses.yml +++ b/.github/workflows/code-analyses.yml @@ -1,8 +1,13 @@ -name: Code analyses +name: Code analyses on: workflow_call: workflow_dispatch: + +permissions: + contents: read + packages: read + jobs: lint-ansible: uses: ./.github/workflows/lint-ansible.yml @@ -30,6 +35,7 @@ jobs: uses: ./.github/workflows/test-install-make.yml test-install-pkgmgr: uses: ./.github/workflows/test-install-pkgmgr.yml + code-analyses: needs: - lint-python @@ -45,3 +51,6 @@ jobs: - test-install-make - test-install-pkgmgr runs-on: ubuntu-latest + steps: + - name: Done + run: echo "All checks passed." diff --git a/.github/workflows/lint-ansible.yml b/.github/workflows/lint-ansible.yml index 76e8c897e5..0595ae21f2 100644 --- a/.github/workflows/lint-ansible.yml +++ b/.github/workflows/lint-ansible.yml @@ -3,6 +3,10 @@ name: Ansible Linter on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-unit: runs-on: ubuntu-latest @@ -16,4 +20,4 @@ jobs: run: docker version - name: Run lint-ansible via make - run: make lint-ansible \ No newline at end of file + run: make lint-ansible diff --git a/.github/workflows/lint-docker.yml b/.github/workflows/lint-docker.yml index 98b3829d7f..fe67eb104f 100644 --- a/.github/workflows/lint-docker.yml +++ b/.github/workflows/lint-docker.yml @@ -1,11 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# hadoint is a Dockerfile linter written in Haskell -# that helps you build best practice Docker images. -# More details at https://github.com/hadolint/hadolint - name: Docker Linter on: @@ -19,9 +11,9 @@ jobs: name: Run hadolint scanning runs-on: ubuntu-latest permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + contents: read + security-events: write + actions: read steps: - name: Checkout code uses: actions/checkout@v6 diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index 4b40366f96..921b856cea 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -3,6 +3,9 @@ name: Python Linter on: workflow_call: +permissions: + contents: read + jobs: lint-python: name: lint-python diff --git a/.github/workflows/lint-shell.yml b/.github/workflows/lint-shell.yml index f091a3223f..41ede9e76c 100644 --- a/.github/workflows/lint-shell.yml +++ b/.github/workflows/lint-shell.yml @@ -3,6 +3,9 @@ name: Shell Linter on: workflow_call: +permissions: + contents: read + jobs: lint-shell: runs-on: ubuntu-latest diff --git a/.github/workflows/test-code-integration.yml b/.github/workflows/test-code-integration.yml index 2b3b8a49a2..4366aedef6 100644 --- a/.github/workflows/test-code-integration.yml +++ b/.github/workflows/test-code-integration.yml @@ -3,6 +3,10 @@ name: Test Infinito.Nexus Code on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-code-integration: runs-on: ubuntu-latest @@ -17,4 +21,3 @@ jobs: - name: Run integration tests via make run: make test-integration - diff --git a/.github/workflows/test-code-lint.yml b/.github/workflows/test-code-lint.yml index 5862a481ca..73ed7aff9c 100644 --- a/.github/workflows/test-code-lint.yml +++ b/.github/workflows/test-code-lint.yml @@ -3,6 +3,10 @@ name: Test Infinito.Nexus Code on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-code-lint: runs-on: ubuntu-latest @@ -17,4 +21,3 @@ jobs: - name: Run custom lint tests via make run: make test-lint - diff --git a/.github/workflows/test-code-unit.yml b/.github/workflows/test-code-unit.yml index e211043ccb..be0f73f9e9 100644 --- a/.github/workflows/test-code-unit.yml +++ b/.github/workflows/test-code-unit.yml @@ -3,6 +3,9 @@ name: Test Units on: workflow_call: +permissions: + contents: read + jobs: test-unit: runs-on: ubuntu-latest diff --git a/.github/workflows/test-deploy-server.yml b/.github/workflows/test-deploy-server.yml index acbbb81338..8e36a0e593 100644 --- a/.github/workflows/test-deploy-server.yml +++ b/.github/workflows/test-deploy-server.yml @@ -3,6 +3,10 @@ name: Test Infinito.Nexus Deploy (server) on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/test-deploy-universal.yml b/.github/workflows/test-deploy-universal.yml index e51360d1e4..13b19f2934 100644 --- a/.github/workflows/test-deploy-universal.yml +++ b/.github/workflows/test-deploy-universal.yml @@ -3,6 +3,10 @@ name: Test Infinito.Nexus Deploy (universal) on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/test-deploy-workstation.yml b/.github/workflows/test-deploy-workstation.yml index 68b7fe633f..6ed6973151 100644 --- a/.github/workflows/test-deploy-workstation.yml +++ b/.github/workflows/test-deploy-workstation.yml @@ -3,6 +3,10 @@ name: Test Infinito.Nexus Deploy (workstation) on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/test-install-make.yml b/.github/workflows/test-install-make.yml index f7f8153cde..fc4c08ab64 100644 --- a/.github/workflows/test-install-make.yml +++ b/.github/workflows/test-install-make.yml @@ -3,6 +3,10 @@ name: Install Infinito.Nexus with Make on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-install-make: runs-on: ubuntu-latest diff --git a/.github/workflows/test-install-pkgmgr.yml b/.github/workflows/test-install-pkgmgr.yml index e7a3bde759..12346bc2ee 100644 --- a/.github/workflows/test-install-pkgmgr.yml +++ b/.github/workflows/test-install-pkgmgr.yml @@ -3,6 +3,10 @@ name: Install Infinito.Nexus with Package Manager (pkgmgr) on: workflow_call: +permissions: + contents: read + packages: read + jobs: test-install-pkgmgr: runs-on: ubuntu-latest