-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix
slap changelog diff pr update --use github-actions
command…
… used by the `NklasRosenstein/slap@gha/changelog/update/v2` action to support forks. (#91) * fix: Fix `slap changelog diff pr update --use github-actions` command used by the `NklasRosenstein/slap@gha/changelog/update/v2` action to support forks. * try GITHUB_REF as head ref * need to get rid of the refs prefix * fix pull request head? * introduced dedicated branch name variable * designate to proper refs * fix assertion * back to using the head repository directly * use GIT_ASKPASS * ensure askpass is executable; * set gitpython env * try uppercase * log askpass script * assert that GITHUB_TOKEN cannot be empty * post comment to PR if PR is from a fork * use "token" instead of "Bearer" * nvm, GitHub API also uses "Bearer" * allow failure fetching comments * use correct session * add X-GitHub-Api-Version * log response text * log GITHUB_REF * support reading pull request id from GITHUB_PR_ID * update * update comment * retry pushing to forked repo * test the pull_request and pull_request_target events * improvement: Store templates that can be created with `slap init` in files instead of in code, improve Python template to include `pycln` and a dummy for running `slap run docs:build`, updated Github actions workflow templates to use `pull_request_target` for changelog validation * update pyproject.toml template * upadte docsg * improvement: add `skip-checks: true` to commits pushed by `slap changelog diff pr update` * update workflow * update default
- Loading branch information
1 parent
336da40
commit 81d5326
Showing
18 changed files
with
812 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[[entries]] | ||
id = "ffb21822-a989-49f8-9e7d-ea8af5c2de2a" | ||
type = "fix" | ||
description = "Fix `slap changelog diff pr update --use github-actions` command used by the `NklasRosenstein/slap@gha/changelog/update/v2` action to support forks." | ||
author = "@NiklasRosenstein" | ||
|
||
[[entries]] | ||
id = "84d57dba-1ae8-41a8-86f1-122ef992098e" | ||
type = "improvement" | ||
description = "Store templates that can be created with `slap init` in files instead of in code, improve Python template to include `pycln` and a dummy for running `slap run docs:build`, updated Github actions workflow templates to use `pull_request_target` for changelog validation" | ||
author = "@NiklasRosenstein" | ||
|
||
[[entries]] | ||
id = "724c14e9-d83a-43de-95ec-03a02153c907" | ||
type = "improvement" | ||
description = "add `skip-checks: true` to commits pushed by `slap changelog diff pr update`" | ||
author = "@NiklasRosenstein" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will run on every pull request to the develop branch to do the following: | ||
# | ||
# - Insert the Pull Request URL into new changelog entries. | ||
# - Assert that a new changelog entry has been added in the PR unless a "no changelog" label is added to the PR. | ||
|
||
name: "Changelog" | ||
|
||
on: | ||
pull_request_target: { branches: [ "develop" ] } | ||
|
||
jobs: | ||
changelog-update: | ||
name: "Insert Pull Request URL into new changelog entries" | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request_target' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: NiklasRosenstein/slap@gha/changelog/update/v2 | ||
with: { pr-id: '${{ github.event.pull_request.number }}' } | ||
|
||
assert-new-changelog-entries: | ||
name: "At least one new changelog entry must be added" | ||
runs-on: ubuntu-latest | ||
if: github.base_ref != '' && !contains(github.event.pull_request.labels.*.name, 'no changelog') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: NiklasRosenstein/slap@gha/changelog/assert-added/v2 | ||
with: { pr-id: '${{ github.event.pull_request.number }}' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.