From 3afd1dda2eda21b59103e567a56749aa82d636c3 Mon Sep 17 00:00:00 2001 From: Simon Friedberger Date: Thu, 5 Sep 2024 15:23:13 +0200 Subject: [PATCH] Add another action --- .github/workflows/fmt-pr.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/fmt-pr.yml diff --git a/.github/workflows/fmt-pr.yml b/.github/workflows/fmt-pr.yml new file mode 100644 index 0000000000..0657ecdc07 --- /dev/null +++ b/.github/workflows/fmt-pr.yml @@ -0,0 +1,33 @@ +name: fmt-pr + +on: + pull_request: + +permissions: + pull-requests: write + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "stable" + - name: run validations + id: fmt + run: | + cd tools + if go run ./psltool fmt -d ../public_suffix_list.dat; then + echo 'msg="Nothing to format."' >> "$GITHUB_OUTPUT" + else + echo 'msg="Formatting needs to be fixed."' >> "$GITHUB_OUTPUT" + fi + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + "Hello, world! :wave:" + "${{ steps.fmt.outputs.msg }}" +