diff --git a/.github/workflows/update-actions-runner.yml b/.github/workflows/update-actions-runner.yml index b6f24e1..abfb872 100644 --- a/.github/workflows/update-actions-runner.yml +++ b/.github/workflows/update-actions-runner.yml @@ -2,7 +2,7 @@ name: Get latest GitHub Actions Runner on: schedule: - - cron: '40 18 * * *' + - cron: "40 18 * * *" jobs: update-runner: runs-on: ubuntu-latest @@ -11,11 +11,13 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.ROBOT_MAC_FC_TOKEN }} + - name: Set release version and current version variables id: get-versions run: | echo ::set-output name=current_tag::$(grep ACTIONS_VERSION Dockerfile | cut -d'=' -f 2 | sed -e 's/^"//' -e 's/"$//') echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/actions/runner/releases/latest | jq -r ".tag_name[1:] | tostring") + - name: Change release version in Dockerfile if: ${{ steps.get-versions.outputs.release_tag != steps.get-versions.outputs.current_tag }} id: update-version @@ -24,26 +26,18 @@ jobs: NEW_VERSION: ${{ steps.get-versions.outputs.release_tag }} run: | sed -i --expression='s,"'"$OLD_VERSION"'","'"$NEW_VERSION"'",g' Dockerfile - - name: set up Git - if: ${{ steps.get-versions.outputs.release_tag != steps.get-versions.outputs.current_tag }} - env: - GITHUB_TOKEN: ${{ secrets.ROBOT_MAC_FC_TOKEN }} - GITHUB_ACTOR_NAME: "@robot-mac-fc" - GITHUB_ACTOR_EMAIL: "robot-mac-fc@users.noreply.github.com" - run: | - git config --global user.name "${GITHUB_ACTOR_NAME}" - git config --global user.email "${GITHUB_ACTOR_EMAIL}" + - name: Create Pull Request if: ${{ steps.get-versions.outputs.release_tag != steps.get-versions.outputs.current_tag }} uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.ROBOT_MAC_FC_TOKEN }} commit-message: Update actions runner to new version - author: ${GITHUB_ACTOR_NAME} <${GITHUB_ACTOR_EMAIL}> + author: robot-mac-fc branch: update-actions-runner-to-${{ steps.get-versions.outputs.release_tag }} delete-branch: true title: Update Actions Runner Version to ${{ steps.get-versions.outputs.release_tag }} body: | Automated update from Github Actions Runner version ${{ steps.get-versions.outputs.current_tag }} to version ${{ steps.get-versions.outputs.release_tag }} Release Notes: https://github.com/actions/runner/releases/tag/v${{ steps.get-versions.outputs.release_tag }} - team-reviewers: MAC-FC \ No newline at end of file + team-reviewers: MAC-FC