From 5d8041ff75c4a0cf175d3e784c61235ef23c3291 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 20 Apr 2022 08:32:51 +0100 Subject: [PATCH] Test actions/checkout#770 This fix should allow setting safe.directory manually and not having it overridden by the actions/checkout action. Test the behaviour works as expected for both the Cygwin runner (with a manually set safe.directory in the Git config file) and the Ubuntu runner (with no explicit safe.directory wrangling). Disable build steps that are unnecessary / slow / would produce permanent changes. Enable steps that we want to check with this action even though they'd normally only be run for actual releases (subject to the previous caveat). --- .github/workflows/ci.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e8610f..36ae7dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: shell: bash --noprofile --norc -e -o pipefail -o igncr {0} env: PATH: C:\cygwin\bin - HOME: C:\cygwin\home\runneradmin steps: - name: Install Cygwin Git uses: cygwin/cygwin-install-action@v2 @@ -24,7 +23,9 @@ jobs: run: git config --global --add safe.directory '*' timeout-minutes: 1 - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@users/tihuang/setsafedirinput + with: + set-safe-directory: false timeout-minutes: 1 - name: Load packages to install id: cyg-package-list @@ -59,6 +60,7 @@ jobs: run: cygport git.cygport compile timeout-minutes: 30 - name: Cygport test + if: false run: cygport git.cygport test timeout-minutes: 300 - name: Cygport install @@ -68,7 +70,7 @@ jobs: run: cygport git.cygport package timeout-minutes: 5 - name: Configure SSH - if: github.ref == 'refs/heads/main' + if: false env: MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }} run: | @@ -78,7 +80,7 @@ jobs: echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts timeout-minutes: 1 - name: Cygport stage - if: github.ref == 'refs/heads/main' + if: false run: SSH_KEY=~/.ssh/id_rsa cygport git.cygport stage timeout-minutes: 5 - name: Tar up build results @@ -95,7 +97,6 @@ jobs: timeout-minutes: 5 release: - if: github.ref == 'refs/heads/main' needs: build-test runs-on: ubuntu-latest permissions: @@ -106,11 +107,8 @@ jobs: sudo apt-get update sudo apt-get install lftp timeout-minutes: 5 - - name: Configure safe.directory # Workaround for actions/checkout#760 - run: git config --global --add safe.directory '*' - timeout-minutes: 1 - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@users/tihuang/setsafedirinput with: fetch-depth: 0 timeout-minutes: 1 @@ -152,7 +150,7 @@ jobs: GIT_COMMITTER_NAME: ${{ github.actor }} GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com run: | - git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}' + git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}-test' git push origin tag 'v${{ steps.release-name.outputs.release }}' timeout-minutes: 1 - name: Create a GitHub release @@ -163,6 +161,7 @@ jobs: git-*/dist/git/* git-*/dist/git/*/* target_commitish: ${{ github.ref }} + draft: true timeout-minutes: 2 - name: Configure SSH env: @@ -174,6 +173,7 @@ jobs: echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts timeout-minutes: 1 - name: Mirror to Cygwin Git repositories + if: false run: git push cygwin@cygwin.com:/git/cygwin-packages/git 'v${{ steps.release-name.outputs.release }}' timeout-minutes: 5 - name: Release on the Cygwin mirror @@ -182,6 +182,5 @@ jobs: set cmd:interactive on; set net:max-retries 1; open sftp://cygwin:@cygwin.com; - put /dev/null -o /x86/release/git/!ready; - put /dev/null -o /x86_64/release/git/!ready;' + ls;' timeout-minutes: 5