]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
♻ Update GitHub actions (#1746)
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 20 Jul 2020 16:56:13 +0000 (18:56 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 16:56:13 +0000 (18:56 +0200)
* 🐛 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

.github/workflows/build-docs.yml
.github/workflows/publish.yml
scripts/gitter_releases_bot.py
scripts/trigger-docs-preview.sh [deleted file]

index c541526992e0ccd4b154c1a109d5022908b59692..1bda0429abf674caddeb7e2c68b238e0fcf35321 100644 (file)
@@ -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:
index e25bf19283b08dea2fe35e7e0137fec7f88971d1..cd63e6c356e6bc385bf838bc8158cf7e186f1741 100644 (file)
@@ -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
index 4e5b1c3d01dddef035657ec1d1c1d4a51beb91b3..718ddc3b63e5c6c718c3cf9aabcf1bc2f79080ef 100644 (file)
@@ -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 (file)
index d08d7d4..0000000
+++ /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}"'"}}'