-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align GitHub Actions config more closely with Spring Boot
- Loading branch information
1 parent
d34584b
commit ef12eff
Showing
12 changed files
with
166 additions
and
118 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,20 @@ | ||
name: Await HTTP Resource | ||
description: 'Waits for an HTTP resource to be available (a HEAD request succeeds)' | ||
inputs: | ||
url: | ||
description: 'URL of the resource to await' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Await HTTP resource | ||
shell: bash | ||
run: | | ||
url=${{ inputs.url }} | ||
echo "Waiting for $url" | ||
until curl --fail --head --silent ${{ inputs.url }} > /dev/null | ||
do | ||
echo "." | ||
sleep 60 | ||
done | ||
echo "$url is available" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: Create GitHub Release | ||
description: Create the release on GitHub with a changelog | ||
description: 'Create the release on GitHub with a changelog' | ||
inputs: | ||
milestone: | ||
description: Name of the GitHub milestone for which a release will be created | ||
required: true | ||
token: | ||
description: Token to use for authentication with GitHub | ||
description: 'Name of the GitHub milestone for which a release will be created' | ||
required: true | ||
pre-release: | ||
description: Whether the release is a pre-release (a milestone or release candidate) | ||
description: 'Whether the release is a pre-release (a milestone or release candidate)' | ||
required: false | ||
default: 'false' | ||
token: | ||
description: 'Token to use for authentication with GitHub' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Generate Changelog | ||
uses: spring-io/github-changelog-generator@185319ad7eaa75b0e8e72e4b6db19c8b2cb8c4c1 #v0.0.11 | ||
with: | ||
config-file: .github/actions/create-github-release/changelog-generator.yml | ||
milestone: ${{ inputs.milestone }} | ||
token: ${{ inputs.token }} | ||
config-file: .github/actions/create-github-release/changelog-generator.yml | ||
- name: Create GitHub Release | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
shell: bash | ||
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md ${{ inputs.pre-release == 'true' && '--prerelease' || '' }} |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
changelog: | ||
repository: spring-projects/spring-restdocs | ||
sections: | ||
- title: ":star: New Features" | ||
labels: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
name: Send Notification | ||
description: Sends a Google Chat message as a notification of the job's outcome | ||
description: 'Sends a Google Chat message as a notification of the job''s outcome' | ||
inputs: | ||
webhook-url: | ||
description: 'Google Chat Webhook URL' | ||
required: true | ||
status: | ||
description: 'Status of the job' | ||
required: true | ||
build-scan-url: | ||
description: 'URL of the build scan to include in the notification' | ||
required: false | ||
run-name: | ||
description: 'Name of the run to include in the notification' | ||
required: false | ||
default: ${{ format('{0} {1}', github.ref_name, github.job) }} | ||
status: | ||
description: 'Status of the job' | ||
required: true | ||
webhook-url: | ||
description: 'Google Chat Webhook URL' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
- name: Prepare Variables | ||
shell: bash | ||
run: | | ||
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV" | ||
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV" | ||
- shell: bash | ||
- name: Success Notification | ||
if: ${{ inputs.status == 'success' }} | ||
shell: bash | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true | ||
- shell: bash | ||
- name: Failure Notification | ||
if: ${{ inputs.status == 'failure' }} | ||
shell: bash | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true | ||
- shell: bash | ||
- name: Cancel Notification | ||
if: ${{ inputs.status == 'cancelled' }} | ||
shell: bash | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true |
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.