From 131a751604b6ab32ab50c6b6eeac0ad330103cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Thu, 4 Apr 2024 12:10:20 +0300 Subject: [PATCH 1/2] Remove .gitconfig, upgrade actions Upgrade actions to latest. Remove .gitconfig. --- .github/workflows/PR-checker.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PR-checker.yml b/.github/workflows/PR-checker.yml index 4149c89..0600e61 100644 --- a/.github/workflows/PR-checker.yml +++ b/.github/workflows/PR-checker.yml @@ -19,9 +19,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up golang - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.golang-ver }} - name: Golang version @@ -36,6 +36,9 @@ jobs: run: scripts-internal/golang/go_build_script.sh --all - name: Run make.sh test (go vet + go test) run: ./make.sh test + - name: Cleanup .gitconfig + if: always() + run: rm -f ~/.gitconfig pysh-check: runs-on: ubuntu-latest @@ -45,11 +48,14 @@ jobs: git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github.com/".insteadOf "git@github.com:" git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github".insteadOf "https://github" - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: git clone git@github.com:PelionIoT/scripts-internal.git - name: Run pysh-check run: | sudo apt install pycodestyle pydocstyle black echo "." >scripts-internal/.nopyshcheck echo "." >vendor/.nopyshcheck - scripts-internal/pysh-check/pysh-check.sh --workdir . \ No newline at end of file + scripts-internal/pysh-check/pysh-check.sh --workdir . + - name: Cleanup .gitconfig + if: always() + run: rm -f ~/.gitconfig \ No newline at end of file From 37730541c8e5cfe8019cb374336d467045b30f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Thu, 4 Apr 2024 22:42:45 +0300 Subject: [PATCH 2/2] Use git-config from PelionIoT/actions --- .github/workflows/PR-checker.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/PR-checker.yml b/.github/workflows/PR-checker.yml index 0600e61..2ba93c1 100644 --- a/.github/workflows/PR-checker.yml +++ b/.github/workflows/PR-checker.yml @@ -26,10 +26,10 @@ jobs: go-version: ${{ matrix.golang-ver }} - name: Golang version run: go version - - name: Set GitHub access token via git config - run: | - git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github.com/".insteadOf "git@github.com:" - git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github".insteadOf "https://github" + - name: Set access token for internal repo access + uses: PelionIoT/actions/.github/actions/git-config@main + with: + github_token: ${{ secrets.ACCESS_TOKEN }} - run: sudo apt install golint - run: git clone git@github.com:PelionIoT/scripts-internal.git - name: Build all @@ -43,10 +43,10 @@ jobs: pysh-check: runs-on: ubuntu-latest steps: - - name: Set GitHub access token via git config - run: | - git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github.com/".insteadOf "git@github.com:" - git config --global url."https://${{ secrets.ACCESS_TOKEN }}@github".insteadOf "https://github" + - name: Set access token for internal repo access + uses: PelionIoT/actions/.github/actions/git-config@main + with: + github_token: ${{ secrets.ACCESS_TOKEN }} - name: Check out code uses: actions/checkout@v4 - run: git clone git@github.com:PelionIoT/scripts-internal.git