Update Volta #493
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
name: Update Volta | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/update-volta.yml' | |
- 'volta.version' | |
schedule: | |
# Checkout for updates daily at midnight | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
update-volta: | |
name: Update volta | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | |
- name: Fetch latest volta release | |
id: volta | |
run: | | |
# Get the latest tag from GitHub | |
voltaTag=$(curl -sL https://api.github.com/repos/volta-cli/volta/releases/latest | jq -r ".tag_name") | |
# Get the latest tag notes from GitHub | |
voltaReleaseNotes=$(curl -sL https://api.github.com/repos/volta-cli/volta/releases/latest | jq -r ".body") | |
# Remove the `v` prefix from the tag | |
voltaVersion=${voltaTag:1} | |
# Store the latest version | |
echo ::set-output name=release_tag::$voltaVersion | |
# Store the latest release notes | |
echo ::set-output name=release_notes::$voltaReleaseNotes | |
# Get the current version stored in volta.version | |
echo ::set-output name=current_tag::$(< volta.version) | |
# If the version of volta has updated, save it to volta.version | |
- name: Update volta version | |
if: steps.volta.outputs.current_tag != steps.volta.outputs.release_tag | |
run: | | |
echo ${{ steps.volta.outputs.release_tag }} > volta.version | |
# If the version of volta has updated, open a pull request to | |
# update the version used in Docker. | |
- name: Create pull request | |
if: steps.volta.outputs.current_tag != steps.volta.outputs.release_tag | |
uses: peter-evans/create-pull-request@331d02c7e2104af23ad5974d4d5cbc58a3e6dc77 # v4 | |
with: | |
title: Update Volta from `v${{ steps.volta.outputs.current_tag }}` to `v${{ steps.volta.outputs.release_tag }}` | |
commit-message: "feat(`volta.version`): update Volta from ${{ steps.volta.outputs.current_tag }} to ${{ steps.volta.outputs.release_tag }}" | |
body: | | |
This PR contains the following updates: | |
| Package | Change | | |
|---|---| | |
| ⚡ [volta-cli/volta](https://github.com/volta-cli/volta) | `v${{ steps.volta.outputs.current_tag }}` -> `v${{ steps.volta.outputs.release_tag }}` | | |
--- | |
### Release Notes | |
<details> | |
<summary>volta-cli/volta <code>v${{ steps.volta.outputs.release_tag }}</code></summary> | |
### [`v${{ steps.volta.outputs.release_tag }}`](https://github.com/volta-cli/volta/releases/tag/v${{ steps.volta.outputs.release_tag }}) | |
${{ steps.volta.outputs.release_notes }} | |
[Compare ${{ steps.volta.outputs.release_tag }} with ${{ steps.volta.outputs.current_tag }}](https://github.com/volta-cli/volta/compare/v${{ steps.volta.outputs.current_tag }}...v${{ steps.volta.outputs.release_tag }}) | |
</details> | |
--- | |
### Configuration | |
📅 **Schedule**: Daily at midnight UTC. | |
🚦 **Automerge**: Enabled. This pull request will be automatically merged once status checks have passed. | |
--- | |
This PR has been generated by the [update-volta](.github/workflows/update-volta.yml) workflow. 🖖 | |
assignees: | | |
domjtalbot | |
labels: | | |
bot | |
automerge | |
branch: feature/volta-${{ steps.volta.outputs.release_tag }} | |
add-paths: | | |
volta.version | |
delete-branch: true | |
token: ${{ secrets.GH_AUTH }} | |