From 4905394a135df8b95f34acf55978a370fd29d0fa Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Thu, 20 Jan 2022 15:57:32 -0800 Subject: [PATCH 1/7] Added auto-update for vendored files --- .github/workflows/update-vendored-files.yaml | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/update-vendored-files.yaml diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml new file mode 100644 index 00000000..9ce527d2 --- /dev/null +++ b/.github/workflows/update-vendored-files.yaml @@ -0,0 +1,24 @@ +name: Update Vendored Files + +on: + repository_dispatch: + types: rescrape + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + + jobs: + update-files: + name: "Update Files" + runs-on: ubuntu-latest + steps: + - name: Update Files + uses: actions/checkout@v2 + - name: Run Download Script + run: | + ./vendor.sh download + - name: Upload Updated Files + run: | + git add . + git commit -m "Updated vendor files" + git push --force From 36cd13e002761dbed86c22fff83b17cdd254827f Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Thu, 20 Jan 2022 15:59:00 -0800 Subject: [PATCH 2/7] Separated out jobs yaml --- .github/workflows/update-vendored-files.yaml | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 9ce527d2..2fb98fe8 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -7,18 +7,18 @@ on: schedule: - cron: "0 0 * * *" - jobs: - update-files: - name: "Update Files" - runs-on: ubuntu-latest - steps: - - name: Update Files - uses: actions/checkout@v2 - - name: Run Download Script - run: | - ./vendor.sh download - - name: Upload Updated Files - run: | - git add . - git commit -m "Updated vendor files" - git push --force +jobs: + update-files: + name: "Update Files" + runs-on: ubuntu-latest + steps: + - name: Update Files + uses: actions/checkout@v2 + - name: Run Download Script + run: | + ./vendor.sh download + - name: Upload Updated Files + run: | + git add . + git commit -m "Updated vendor files" + git push --force From d25e4d78e3b5d2dd4c587481eab4b5a50626a336 Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Thu, 20 Jan 2022 16:05:31 -0800 Subject: [PATCH 3/7] Added credentials for update script --- .github/workflows/update-vendored-files.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 2fb98fe8..489a2370 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -19,6 +19,7 @@ jobs: ./vendor.sh download - name: Upload Updated Files run: | - git add . - git commit -m "Updated vendor files" - git push --force + git config --global user.name "Go Tree Sitter Bot" + gir config --global user.email "smacker@users.noreply.github.com" + git commit -am "Updated vendor files" + git push From 20743387ab6ec24a75322b40006cd5746792a427 Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Thu, 20 Jan 2022 16:07:24 -0800 Subject: [PATCH 4/7] Fixed typo in git command --- .github/workflows/update-vendored-files.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 489a2370..4eb7996e 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -20,6 +20,6 @@ jobs: - name: Upload Updated Files run: | git config --global user.name "Go Tree Sitter Bot" - gir config --global user.email "smacker@users.noreply.github.com" + git config --global user.email "smacker@users.noreply.github.com" git commit -am "Updated vendor files" git push From 14859717336fe9858308ad6d157c20a6e7dc91e7 Mon Sep 17 00:00:00 2001 From: Maxim Sukharev Date: Wed, 9 Feb 2022 11:57:58 +0800 Subject: [PATCH 5/7] Remove empty workflow --- .github/workflows/update-vendored-files.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 4eb7996e..8713d06a 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -1,9 +1,6 @@ name: Update Vendored Files on: - repository_dispatch: - types: rescrape - workflow_dispatch: schedule: - cron: "0 0 * * *" From f0653a8340fb62a4ac89c684e8734ee1ffa1e02e Mon Sep 17 00:00:00 2001 From: Maxim Sukharev Date: Wed, 9 Feb 2022 12:04:32 +0800 Subject: [PATCH 6/7] Run tests before commiting changes --- .github/workflows/update-vendored-files.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 8713d06a..488e71a0 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -2,18 +2,25 @@ name: Update Vendored Files on: schedule: - - cron: "0 0 * * *" + - cron: '0 0 * * *' jobs: update-files: - name: "Update Files" + name: 'Update Files' runs-on: ubuntu-latest steps: - name: Update Files uses: actions/checkout@v2 - name: Run Download Script + run: ./vendor.sh download + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: Run tests run: | - ./vendor.sh download + go get -t ./... + go test -v ./... - name: Upload Updated Files run: | git config --global user.name "Go Tree Sitter Bot" From 431608d935b705110006ec676f6153ea8da4f03e Mon Sep 17 00:00:00 2001 From: Maxim Sukharev Date: Wed, 9 Feb 2022 12:08:05 +0800 Subject: [PATCH 7/7] Temporary commit to validate the workflow --- .github/workflows/update-vendored-files.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-vendored-files.yaml b/.github/workflows/update-vendored-files.yaml index 488e71a0..05bf9137 100644 --- a/.github/workflows/update-vendored-files.yaml +++ b/.github/workflows/update-vendored-files.yaml @@ -1,6 +1,9 @@ name: Update Vendored Files on: + pull_request: + branches: + - master schedule: - cron: '0 0 * * *' @@ -26,4 +29,3 @@ jobs: git config --global user.name "Go Tree Sitter Bot" git config --global user.email "smacker@users.noreply.github.com" git commit -am "Updated vendor files" - git push