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: use our reusable org workflows #226

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
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
41 changes: 6 additions & 35 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,11 @@ on:
types:
- opened
- edited
permissions:
contents: read
- synchronize

jobs:
pr-title-lint:
trigger:
uses: statnett/workflows/.github/workflows/lint-pr.yml@main
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment to create or update PR comment
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@47b15d52c5c30e94a17ec87eb8dd51ff5221fed9 # v5.3.0
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
# yamllint disable rule:line-length
message: |
Hey there and thank you for opening this pull request! :wave:

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```
# yamllint enable rule:line-length
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
with:
header: pr-title-lint-error
delete: true
pull-requests: write
statuses: write
26 changes: 7 additions & 19 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@ on:
branches:
- main
workflow_dispatch:
permissions:
contents: write # for google-github-actions/release-please-action to create release commit
pull-requests: write # for google-github-actions/release-please-action to create release PR

jobs:
release-please:
runs-on: ubuntu-latest
if: ${{ github.repository == 'statnett/controller-runtime-viper' }}
steps:
- uses: google-github-actions/release-please-action@4c5670f886fe259db4d11222f7dff41c1382304d # v3.7.12
with:
token: ${{ secrets.BOT_PAT }}
# TODO: Eventually remove this, when we are ready for GA (version 1.0.0)
bump-minor-pre-major: true
changelog-types: >
[
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "build", "scope": "deps", "section": "Dependency Updates" }
]
release-type: go
trigger:
uses: statnett/workflows/.github/workflows/release-please.yml@main
secrets: inherit
permissions:
contents: write
pull-requests: write
Loading