Skip to content

Commit

Permalink
Add new workflow (it will be broken) (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
willGraham01 authored Mar 26, 2024
1 parent ed515cd commit 4811a68
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/fetch_sha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test context throws

on:
workflow_dispatch:
# Allow profiling to be triggered by comments on pull requests
# Trigger is /run profiling
issue_comment:
types:
- created
# Profile the model every Saturday at 00:00,
# on the HEAD of master
push:
branches:
- "main"

concurrency:
group: fetch-sha-${{ github.workflow }}-${{ github.ref }}

jobs:
set-variables:
name: Create unique output file identifier and artifact name
runs-on: ubuntu-latest
if: (github.event_name != 'issue_comment') || ((github.event_name == 'issue_comment') && (github.event.comment.body == '/report sha!'))
outputs:
sha: ${{ steps.determine-correct-sha.outputs.result }}
steps:
- id: determine-correct-sha
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (!context.payload.issue.pull_request) {
return context.sha;
};
const { data: pr } = await github.rest.pulls.get({
owner: context.issue.owner,
repo: context.issue.repo,
pull_number: context.issue.number,
});
return pr.head.sha;
report-sha:
name: Report SHA that was recovered
runs-on: ubuntu-latest
needs: set-variables
steps:
- name: Report SHA
run: |
echo ""
- id: set-profiling-filename
name: Set profiling output file name
run: |
echo "name=${GITHUB_EVENT_NAME}
echo "SHA=${{ needs.set-variables.outputs.sha }}"

0 comments on commit 4811a68

Please sign in to comment.