Fix branch name #1
Workflow file for this run
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
on: | |
push: | |
branches: [heston/DOCS-8410-workflow] | |
# schedule: | |
# # At 08:00 on every day-of-week from Monday through Friday. | |
# - cron: '0 8 * * 1-5' | |
permissions: {} | |
jobs: | |
synthetics-worker-version: | |
permissions: | |
contents: write # for git push | |
pull-requests: write # to create pull request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate a token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.DOCS_GH_APP_ID }} | |
private-key: ${{ secrets.DOCS_GH_APP_PRIVATE_KEY }} | |
- id: set-worker-version | |
name: Load latest worker version | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ steps.generate-token.outputs.token }} | |
result-encoding: string | |
script: | | |
const tags = await github.rest.repos.listTags({ | |
owner: 'DataDog', | |
repo: 'synthetics-worker' | |
}) | |
const regex = /^(?:(?:[0-9]*)[.](?:[0-9]*)[.](?:[0-9]*))$/; | |
latestTag = tags.data.find(value => regex.test(value)) | |
console.log(latestTag) | |
return latestTag |