Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Group all changelog-related CI jobs into single one #1526

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions .github/workflows/pr-auto-label.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: PR-auto-labeler
name: Changelog automation

on:
pull_request_target:
Expand All @@ -12,11 +12,12 @@ permissions:
checks: write # to generate status

jobs:
remove-old-labels:
name: Remove old PR labels
changelog-automation:
name: Changelog automation
runs-on: ubuntu-latest
steps:
Comment on lines 17 to 18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this condition to skip all these steps when PR is raised by dependabot

runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure if this will have the effect that we want 🤔

A skipped job isn't considered successful, so we will keep blocking dependabot PRs this way 😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Any idea if we use exit with success status, will this work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can probably do something similar :)

- uses: mondeja/remove-labels-gh-action@v2.0.0
- name: Remove old PR labels
uses: mondeja/remove-labels-gh-action@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand All @@ -25,21 +26,13 @@ jobs:
kind/FEATURE
kind/CHANGE
release-note-none
pr-labeler:
runs-on: ubuntu-latest
needs: remove-old-labels
steps:
- name: Check Labels
- name: Add label to PR
id: labeler
uses: jimschubert/labeler-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Adjust the configuration in /.github/labeler.yml

validate-pr-label:
runs-on: ubuntu-latest
needs: pr-labeler
steps:
- name: Verify Label
id: preview_label_check
uses: docker://agilepathway/pull-request-label-checker:latest
Expand All @@ -52,7 +45,7 @@ jobs:
if: steps.preview_label_check.outputs.label_check == 'failure'
with:
message: |
PR body does not contain a valid type of change. Please refer to [CONTRIBUTING.md](https://github.com/prometheus/client_golang/blob/main/CONTRIBUTING.md#how-to-fill-the-pr-template) for more information.
PR body does not contain a valid type of change. Please refer to [CONTRIBUTING.md](https://github.com/prometheus/client_golang/blob/main/CONTRIBUTING.md#how-to-write-a-pr-description) for more information.
comment_tag: labelfailure
mode: recreate
- name: Remove Label Check Failure Comment
Expand Down
Loading