From: Sebastián Ramírez Date: Mon, 20 Jul 2020 16:56:13 +0000 (+0200) Subject: ♻ Update GitHub actions (#1746) X-Git-Tag: 0.60.1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ab2841dbb80bbf8439fc38c2e323065d5c32f0b;p=thirdparty%2Ffastapi%2Ffastapi.git ♻ Update GitHub actions (#1746) * 🐛 Fix Gitter notification, use development gitter room until next release * 🔥 Remove trigger docs preview step from build-docs workflow as it requires a more privileged token, so it's now triggered by the preview docs watcher * 🔊 Dump context when building to allow debugging how to refactor the Gitter bot --- diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c541526992..1bda0429ab 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -24,12 +24,6 @@ jobs: with: name: docs-zip-${{ github.sha }} path: ./docs.zip - - name: Trigger Docs Preview - env: - PR: "${{ github.event.number }}" - NAME: "docs-zip-${{ github.sha }}" - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - run: bash ./scripts/trigger-docs-preview.sh - name: Deploy to Netlify uses: nwtgck/actions-netlify@v1.1.5 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e25bf19283..cd63e6c356 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,13 @@ jobs: FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }} FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} run: bash scripts/publish.sh + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" - name: Notify env: GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.ref }} run: bash scripts/notify.sh diff --git a/scripts/gitter_releases_bot.py b/scripts/gitter_releases_bot.py index 4e5b1c3d01..718ddc3b63 100644 --- a/scripts/gitter_releases_bot.py +++ b/scripts/gitter_releases_bot.py @@ -3,14 +3,14 @@ import os import requests -room_id = "5c9c9540d73408ce4fbc1403" # FastAPI -# room_id = "5cc46398d73408ce4fbed233" # Gitter development +# room_id = "5c9c9540d73408ce4fbc1403" # FastAPI +room_id = "5cc46398d73408ce4fbed233" # Gitter development gitter_token = os.getenv("GITTER_TOKEN") assert gitter_token github_token = os.getenv("GITHUB_TOKEN") assert github_token -tag_name = os.getenv("TRAVIS_TAG") +tag_name = os.getenv("TAG") assert tag_name diff --git a/scripts/trigger-docs-preview.sh b/scripts/trigger-docs-preview.sh deleted file mode 100644 index d08d7d49eb..0000000000 --- a/scripts/trigger-docs-preview.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/env bash - -set -x -set -e - -PR=${PR} - -if [ -z "$PR" ]; then - echo "Not a PR build, skip trigger docs preview" - exit 0 -fi - -NAME=${NAME:?Variable not set} -GITHUB_TOKEN=${GITHUB_TOKEN:?Variable not set} - -curl -v \ - -X POST \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches \ - -d '{"ref":"master", "inputs": {"pr": "'"${PR}"'", "name": "'"${NAME}"'"}}'