Skip to content

Commit

Permalink
Experiment accessing the latest release via github-script
Browse files Browse the repository at this point in the history
Mostly generated by ChatGPT, but I'm pretty sure I don't actually need the checkout
  • Loading branch information
liamhuber committed May 24, 2024
1 parent 7765613 commit 2693175
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/experiment-with-ci-syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Experiment with Syntax

on:
pull_request:


jobs:
experiment:
runs-on: ubuntu-latest
outputs:
latest_release_tag: ${{ steps.get-release.outputs.latest_release_tag }}
steps:
# - name: Checkout code
# uses: actions/checkout@v4

- name: Use GitHub Script to get latest release
id: get-release
uses: actions/github-script@v4
with:
script: |
const response = await github.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
console.log(response.data.tag_name);
return { latest_release_tag: response.data.tag_name }
- name: Echo latest release tag
run: |
echo "Latest release tag: ${{ steps.get-release.outputs.latest_release_tag }}"

0 comments on commit 2693175

Please sign in to comment.