Skip to content

Commit

Permalink
Testing find latest synthetics-worker tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hestonhoffman committed Jul 24, 2024
1 parent c09d42f commit f62db21
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/bump_synthetics_worker_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches: [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

0 comments on commit f62db21

Please sign in to comment.