From 2cfcebfa10df07304405a10482afeadebe72bb90 Mon Sep 17 00:00:00 2001 From: Mircea-Pavel ANTON Date: Fri, 6 Sep 2024 23:15:20 +0000 Subject: [PATCH] ci: update reusable workflow --- .github/workflows/docker-release.yaml | 18 +++++++++++++-- .github/workflows/git-release.yaml | 20 ++++++++++++++--- .github/workflows/meta-label-sync.yaml | 29 +++++++++++++++---------- .github/workflows/meta-labeler.yaml | 9 ++++---- .github/workflows/readme-generator.yaml | 3 +-- .github/workflows/renovate.yaml | 15 ++++++++----- 6 files changed, 66 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index a9e693b..5dec1ce 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -5,22 +5,36 @@ name: Docker Release on: workflow_dispatch: inputs: + dry-run: + description: "Run the action without making changes" + default: true + required: false + type: boolean custom-tag: type: string description: Additional custom tags for the image. required: false + pull_request: branches: ["main"] paths: - Dockerfile + - requirements.txt + push: tags: ["*"] jobs: release: - uses: mirceanton/reusable-workflows/.github/workflows/docker-release.yaml@main + uses: mirceanton/reusable-workflows/.github/workflows/docker-release.yaml@feb7161818c3ae82cd4ea25c606c1feefa19643d secrets: inherit with: image-name: ghcr.io/${{ github.repository }} platforms: linux/amd64 - custom-tag: ${{ inputs.custom-tag }} + tags: | + type=ref,event=tag + type=ref,event=pr + ${{ github.event.inputs.custom-tag }} + context: . + dockerfile: ./Dockerfile + dry-run: "${{ github.event.inputs.dry-run }}" diff --git a/.github/workflows/git-release.yaml b/.github/workflows/git-release.yaml index 367b4eb..94c6679 100644 --- a/.github/workflows/git-release.yaml +++ b/.github/workflows/git-release.yaml @@ -3,13 +3,27 @@ name: Git Release on: - workflow_dispatch: {} + workflow_dispatch: + inputs: + dry-run: + description: "Dry run" + required: false + default: false + type: boolean + + pull_request: + paths: + - ".github/workflows/git-release.yaml" + - "README.md" + push: branches: ["main"] paths: - - README.md # This file should be automatically generated when something changes in the docker image + - "README.md" jobs: release: - uses: mirceanton/reusable-workflows/.github/workflows/git-release-calver.yaml@main + uses: mirceanton/reusable-workflows/.github/workflows/git-release-calver.yaml@feb7161818c3ae82cd4ea25c606c1feefa19643d secrets: inherit + with: + dry-run: ${{ inputs.dry-run || github.event.name == 'pull_request' }} diff --git a/.github/workflows/meta-label-sync.yaml b/.github/workflows/meta-label-sync.yaml index 15d83c7..d3056c6 100644 --- a/.github/workflows/meta-label-sync.yaml +++ b/.github/workflows/meta-label-sync.yaml @@ -1,27 +1,34 @@ --- # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json -name: "Meta: Label Sync" +name: Meta - Label Sync on: - workflow_dispatch: {} # Manual Trigger + workflow_dispatch: + inputs: + dry-run: + description: "Run the action without making changes" + default: true + required: false + type: boolean + + pull_request: + paths: + - ".github/configs/labels.yaml" + - ".github/workflows/meta-label-sync.yaml" + push: branches: ["main"] paths: - ".github/configs/labels.yaml" - ".github/workflows/meta-label-sync.yaml" + schedule: - cron: "0 0 * * *" # Every day at midnight -permissions: - issues: write - -concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.ref }} - cancel-in-progress: true - jobs: label-sync: - uses: mirceanton/reusable-workflows/.github/workflows/meta-label-sync.yaml@main + uses: mirceanton/reusable-workflows/.github/workflows/meta-label-sync.yaml@feb7161818c3ae82cd4ea25c606c1feefa19643d secrets: inherit with: - config-file: .github/configs/labels.yaml + dry-run: ${{ github.event.inputs.dry-run || github.event_name == 'pull_request' }} + config-file: ".github/configs/labels.yaml" diff --git a/.github/workflows/meta-labeler.yaml b/.github/workflows/meta-labeler.yaml index 073b0b7..ab4cc2f 100644 --- a/.github/workflows/meta-labeler.yaml +++ b/.github/workflows/meta-labeler.yaml @@ -1,14 +1,13 @@ --- # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json -name: "Meta: PR Labeler" +name: Meta - Labeler on: - workflow_dispatch: {} # Manual Trigger pull_request_target: {} jobs: - labeler: - uses: mirceanton/reusable-workflows/.github/workflows/meta-labeler.yaml@main + pr-labeler: + uses: mirceanton/reusable-workflows/.github/workflows/meta-labeler.yaml@feb7161818c3ae82cd4ea25c606c1feefa19643d secrets: inherit with: - config-file: .github/configs/labeler.yaml + config-file: ".github/configs/labeler.yaml" diff --git a/.github/workflows/readme-generator.yaml b/.github/workflows/readme-generator.yaml index 251c709..de9fcec 100644 --- a/.github/workflows/readme-generator.yaml +++ b/.github/workflows/readme-generator.yaml @@ -6,8 +6,7 @@ on: workflow_dispatch: {} push: - branches: - - main + branches: ["main"] pull_request: paths: diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index fe976b2..b6a6974 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -5,14 +5,19 @@ name: Renovate on: workflow_dispatch: inputs: - dryRun: + dry-run: description: Dry Run default: "false" required: false - logLevel: + log-level: description: Log Level default: debug required: false + pull_request: + paths: + - ".github/workflows/renovate.yaml" + - ".github/configs/renovate/*.json5" + - "renovate.json5" schedule: - cron: "0 * * * *" # hourly @@ -22,8 +27,8 @@ concurrency: jobs: renovate: - uses: mirceanton/reusable-workflows/.github/workflows/renovate.yaml@main + uses: mirceanton/reusable-workflows/.github/workflows/renovate.yaml@feb7161818c3ae82cd4ea25c606c1feefa19643d secrets: inherit with: - dryRun: "${{ inputs.dryRun == true }}" - logLevel: "${{ inputs.logLevel || 'debug' }}" + dry-run: "${{ inputs.dry-run == true || github.event_name == 'pull_request' }}" + log-level: "${{ inputs.log-level || 'debug' }}"