Update to the latest LimeSurvey tag #6
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 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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 }}" |