From c333b62607e67e9b40ab9c1c47b9bd5c0857d58e Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 24 Oct 2024 12:07:52 -0400 Subject: [PATCH] feat(ci): sync golangci-lint config workflow Automate copying the golangci-lint config from the meta repository to other repositories. --- .github/workflows/lint-sync.yml | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint-sync.yml diff --git a/.github/workflows/lint-sync.yml b/.github/workflows/lint-sync.yml new file mode 100644 index 0000000..d50307f --- /dev/null +++ b/.github/workflows/lint-sync.yml @@ -0,0 +1,34 @@ +name: lint-sync +on: + workflow_call: + +permissions: write-all + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: ${{ github.repository }} + - uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/meta + path: ${{ github.repository_owner }}/meta + - run: | + cp ${{ github.repository_owner }}/meta/golangci.yml ${{ github.repository }}/.golangci.yml + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "chore(ci): sync golangci-lint config" + title: "Sync golangci-lint config" + body: | + This is an automated pull request to sync the golangci-lint config with the meta repository. + branch: "ci/sync-lint-config" + delete-branch: true + - name: Check outputs + if: ${{ steps.cpr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"