-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from edgarrmondragon/automate-updates
Automate updates to the latest 6.x tag
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 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,64 @@ | ||
name: Update to the latest LimeSurvey tag | ||
on: | ||
schedule: | ||
# Daily at 12:00 AM UTC | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get-latest-tag: | ||
name: Get latest LimeSurvey tag | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.get-latest-tag.outputs.tag }} | ||
steps: | ||
- name: Check out the LimeSurvey repository to get the latest tag | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
repository: LimeSurvey/LimeSurvey | ||
ref: master | ||
fetch-depth: 0 | ||
|
||
- name: Get the latest tag | ||
id: get-latest-tag | ||
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | ||
|
||
download-archive: | ||
name: Download LimeSurvey archive | ||
runs-on: ubuntu-latest | ||
needs: [get-latest-tag] | ||
outputs: | ||
checksum: ${{ steps.compute-checksum.outputs.checksum }} | ||
steps: | ||
- name: Download the LimeSurvey archive | ||
id: download-archive | ||
run: | | ||
curl -sSL "https://github.com/LimeSurvey/LimeSurvey/archive/refs/tags/${{ needs.get-latest-tag.outputs.tag }}.tar.gz" --output /tmp/limesurvey.tar.gz | ||
- name: Compute the SHA256 checksum of the archive | ||
id: compute-checksum | ||
run: echo "checksum=$(sha256sum /tmp/limesurvey.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT | ||
|
||
open-pull-request: | ||
name: Open a pull request to update the latest LimeSurvey tag | ||
runs-on: ubuntu-latest | ||
needs: [get-latest-tag, download-archive] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
# Replace in 6.0/*/Dockerfile | ||
# ARG version="<version>" | ||
# ARG sha256_checksum="<sha256_checksum>" | ||
- name: Update the Dockerfiles | ||
run: | | ||
sed -i "s/ARG version=\"[^\"]*\"/ARG version=\"${{ needs.get-latest-tag.outputs.tag }}\"/" 6.0/*/Dockerfile | ||
sed -i "s/ARG sha256_checksum=\"[^\"]*\"/ARG sha256_checksum=\"${{ needs.download-archive.outputs.checksum }}\"/" 6.0/*/Dockerfile | ||
- name: Create a pull request | ||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Upgrading to Version ${{ needs.get-latest-tag.outputs.tag }}" | ||
title: "Upgrading to Version ${{ needs.get-latest-tag.outputs.tag }}" | ||
body: "This PR updates the LimeSurvey version to [${{ needs.get-latest-tag.outputs.tag }}](https://github.com/LimeSurvey/LimeSurvey/releases/tag/${{ needs.get-latest-tag.outputs.tag }})." | ||
branch: "update-limesurvey-to-${{ needs.get-latest-tag.outputs.tag }}" |