Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .github/workflows/fix-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,9 @@ jobs:
with:
pr: ${{ github.event.inputs.pr }}

- name: Get PR info
id: pr-info
run: |
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
echo "::set-output name=repo::$(echo "$PR_JSON" | jq -r .head.repo.full_name)"
echo "::set-output name=branch::$(echo "$PR_JSON" | jq -r .head.ref)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash

- name: Create URL to the run output
- name: Resolve workflow variables
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
uses: aaronsteers/resolve-ci-vars-action@v0

- name: Append comment with job run link
id: first-comment-action
Expand Down Expand Up @@ -138,11 +128,11 @@ jobs:
git add .
git commit -m "Auto-fix lint issues (unsafe)"

- name: Push changes to '(${{ steps.pr-info.outputs.repo }})'
- name: Push changes to '(${{ steps.vars.outputs.pr-source-repo-name-full }})'
if: steps.git-diff.outputs.changes == 'true' || steps.git-diff-2.outputs.changes == 'true'
run: |
git remote add contributor https://github.com/${{ steps.pr-info.outputs.repo }}.git
git push contributor HEAD:${{ steps.pr-info.outputs.branch }}
git remote add contributor https://github.com/${{ steps.vars.outputs.pr-source-repo-name-full }}.git
git push contributor HEAD:${{ steps.vars.outputs.pr-source-git-branch }}

- name: Append success comment
uses: peter-evans/create-or-update-comment@v4
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/poetry-lock-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,9 @@ jobs:
echo "poetry.lock found. Proceeding."
fi

- name: Get PR info
id: pr-info
run: |
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
echo "::set-output name=repo::$(echo "$PR_JSON" | jq -r .head.repo.full_name)"
echo "::set-output name=branch::$(echo "$PR_JSON" | jq -r .head.ref)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash

- name: Create URL to the run output
- name: Resolve workflow variables
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
uses: aaronsteers/resolve-ci-vars-action@v0

- name: Append comment with job run link
id: first-comment-action
Expand Down Expand Up @@ -114,11 +104,11 @@ jobs:
git add .
git commit -m "Auto-commit `poetry lock` changes"

- name: Push changes to '(${{ steps.pr-info.outputs.repo }})'
- name: Push changes to '(${{ steps.vars.outputs.pr-source-repo-name-full }})'
if: steps.git-diff.outputs.changes == 'true'
run: |
git remote add contributor https://github.com/${{ steps.pr-info.outputs.repo }}.git
git push contributor HEAD:${{ steps.pr-info.outputs.branch }}
git remote add contributor https://github.com/${{ steps.vars.outputs.pr-source-repo-name-full }}.git
git push contributor HEAD:${{ steps.vars.outputs.pr-source-git-branch }}

- name: Append success comment
uses: peter-evans/create-or-update-comment@v4
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/test-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Create URL to the run output
- name: Resolve workflow variables
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
uses: aaronsteers/resolve-ci-vars-action@v0

- name: Append comment with job run link
id: first-comment-action
uses: peter-evans/create-or-update-comment@v4
Expand All @@ -44,18 +45,12 @@ jobs:

[1]: ${{ steps.vars.outputs.run-url }}

- name: Get PR Info
id: pr-info
uses: cloudposse-github-actions/[email protected]
with:
id: ${{ inputs.pr }}

outputs:
source-repo: ${{ fromJSON(steps.pr-info.outputs.json).head.repo.full_name }}
source-branch: ${{ fromJSON(steps.pr-info.outputs.json).head.ref }}
commit-sha: ${{ fromJSON(steps.pr-info.outputs.json).head.sha }}
pr-number: ${{ steps.pr-info.outputs.number }}
pr-title: ${{ steps.pr-info.outputs.title }}
source-repo: ${{ steps.vars.outputs.pr-source-repo-name-full }}
source-branch: ${{ steps.vars.outputs.pr-source-git-branch }}
commit-sha: ${{ steps.vars.outputs.pr-source-git-sha }}
pr-number: ${{ steps.vars.outputs.pr-number }}
pr-title: ${{ steps.vars.outputs.pr-title }}
job-run-url: ${{ steps.vars.outputs.run-url }}

# This is copied from the `python_pytest.yml` file.
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/welcome-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Resolve workflow variables
id: vars
uses: aaronsteers/resolve-ci-vars-action@v0

- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
# Use a different template for internal vs forks (community)
template: ${{ github.event.pull_request.head.repo.fork == true && '.github/pr-welcome-community.md' || '.github/pr-welcome-internal.md' }}
template: ${{ steps.vars.outputs.pr-source-is-fork == 'true' && '.github/pr-welcome-community.md' || '.github/pr-welcome-internal.md' }}
vars: |
repo_name: ${{ github.event.pull_request.head.repo.full_name }}
branch_name: ${{ github.event.pull_request.head.ref }}
repo_name: ${{ steps.vars.outputs.pr-source-repo-name-full }}
branch_name: ${{ steps.vars.outputs.pr-source-git-branch }}

- name: Create comment
uses: peter-evans/create-or-update-comment@v4
Expand Down
Loading