forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Command Update UI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: Number of the Pull Request | ||
required: true | ||
rust-version: | ||
description: Version of rust. Example 1.70 | ||
required: false | ||
|
||
jobs: | ||
set-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: set_image | ||
run: cat .github/env >> $GITHUB_OUTPUT | ||
cmd-fmt: | ||
needs: [set-image] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- name: Install gh cli | ||
run: | | ||
(type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ | ||
&& mkdir -p -m 755 /etc/apt/keyrings \ | ||
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ | ||
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
&& apt update \ | ||
&& apt install gh -y | ||
git config --global --add safe.directory '*' | ||
- name: Download repo | ||
uses: actions/checkout@v4 | ||
- run: gh pr checkout ${{ inputs.pr }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Export branch name | ||
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT" | ||
id: branch | ||
- name: Run FMT | ||
run: | | ||
"./scripts/update-ui-tests.sh" "${{ inputs.rust-version }}" | ||
- name: Report failure | ||
if: ${{ failure() }} | ||
run: gh pr comment ${{ inputs.pr }} --body "Run for <code>fmt</code> failed. See logs <a href=\"$RUN\">here</a>." | ||
env: | ||
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
GH_TOKEN: ${{ github.token }} | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: cmd-action - changes | ||
branch: ${{ steps.branch.outputs.branch }} |