From 9dfb075ff22ec35d082e80c922c4a976c24d9da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Daoust?= Date: Fri, 6 Dec 2019 15:22:44 +0100 Subject: [PATCH] Adjust to new actions/checkout v2 directory behavior Version 2 (beta) of the actions/checkout GitHub Action, released 3 days ago, considers that `path` is always relative to `GITHUB_WORKSPACE`. Our steps were expecting them to be relative to the parent folder. As such, `working-directory` directives have become wrong and triggered failures reported in #44. This update fixes the `working-directory` directives and also forces the checkout of `reffy-reports` into a subfolder to avoid integrating files from `reffy` when `git add -A` gets run. --- .github/workflows/update-ed.yml | 27 ++++++++------------------- .github/workflows/update-tr.yml | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/update-ed.yml b/.github/workflows/update-ed.yml index 09660d060989..378bf8a4e9b9 100644 --- a/.github/workflows/update-ed.yml +++ b/.github/workflows/update-ed.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Checkout reffy-reports uses: actions/checkout@master + with: + path: reffy-reports - name: Checkout reffy uses: actions/checkout@master with: @@ -18,36 +20,22 @@ jobs: ref: master fetch-depth: 1 path: reffy - - name: Test base64 decoding - run: base64 --version - working-directory: reffy - - name: Test echo - run: echo "dG90bw==" - working-directory: reffy - - name: Test base64 decoding to a file - run: | - echo "dG90bw==" | base64 --decode > test.txt - cat test.txt - working-directory: reffy - name: Setup node.js uses: actions/setup-node@master with: node-version: 10.x - name: Install pandoc run: sudo apt-get install pandoc - - name: Retrieve W3C API key - env: - CONFIG_JSON: ${{ secrets.CONFIG_JSON }} - run: echo "$CONFIG_JSON" | base64 --decode > config.json - working-directory: reffy - - name: Install Reffy's dependencies - run: npm ci + - name: Setup Reffy + run: | + echo "${{ secrets.CONFIG_JSON }}" | base64 --decode > config.json + npm ci working-directory: reffy - name: Run Reffy's crawler run: npm run ed working-directory: reffy - name: Copy reports - run: rsync -av --exclude=README.md ../reffy/reports/ ./ + run: rsync -av --exclude=README.md reffy/reports/ reffy-reports/ - name: Push updates to git run: | git config user.name "reffy-bot" @@ -59,3 +47,4 @@ jobs: #npm version patch git push origin HEAD:master #git push origin --tags + working-directory: reffy-reports \ No newline at end of file diff --git a/.github/workflows/update-tr.yml b/.github/workflows/update-tr.yml index 13b5369792c4..8fcf103c5d8a 100644 --- a/.github/workflows/update-tr.yml +++ b/.github/workflows/update-tr.yml @@ -8,6 +8,8 @@ jobs: steps: - name: Checkout reffy-reports uses: actions/checkout@master + with: + path: reffy-reports - name: Checkout reffy uses: actions/checkout@master with: @@ -21,17 +23,16 @@ jobs: node-version: 10.x - name: Install pandoc run: sudo apt-get install pandoc - - name: Retrieve W3C API key - run: echo "${{ secrets.CONFIG_JSON }}" | base64 --decode > config.json - working-directory: ../reffy - - name: Install Reffy's dependencies - run: npm ci - working-directory: ../reffy + - name: Setup Reffy + run: | + echo "${{ secrets.CONFIG_JSON }}" | base64 --decode > config.json + npm ci + working-directory: reffy - name: Run Reffy's crawler run: npm run tr - working-directory: ../reffy + working-directory: reffy - name: Copy reports - run: rsync -av --exclude=README.md ../reffy/reports/ ./ + run: rsync -av --exclude=README.md reffy/reports/ reffy-reports/ - name: Push updates to git run: | git config user.name "reffy-bot" @@ -43,3 +44,4 @@ jobs: #npm version patch git push origin HEAD:master #git push origin --tags + working-directory: reffy-reports