Skip to content

Help: PR status update in workflow invoked via comment #25141

Answered by weide-zhou
zimventures asked this question in Actions
Discussion options

You must be logged in to vote

Hi @zimventures ,

This can be completed in the workflow with rest api. Code sample as below:

- name: get the one latest&last sha # get the last commit sha in pull_Requst
        run: |
          URL=${{ github.event.issue.pull_request.url }}/commits
          echo "::set-env name=PRSHA::$(curl -u "weide:${{ secrets.GITHUB_TOKEN }}" -s $URL | jq -r '.[] | .sha' | xargs | awk -F " " '{print $NF}')"
      - name: echo PRSHA # check the lastest SHA
        run: |
          echo $PRSHA
      - name: create the status # create the status on the lastest commit sha from pull request
        run: |
          curl -X POST -u "weide:${{ secrets.PAT0309 }}" -H "Content-Type: application/json" "https:…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants