Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt 2023-05-17 18:52:14 +02:00
parent a321c27376
commit 5bcfd32e1a
3 changed files with 4 additions and 2 deletions

1
.env
View File

@ -5,4 +5,5 @@ PAYLOAD_SECRET=supersecretkey
MONGODB_URI=mongodb://payload:test@mongo:27017 MONGODB_URI=mongodb://payload:test@mongo:27017
MONGODB_USER=payload MONGODB_USER=payload
MONGODB_PW=test MONGODB_PW=test
TOKEN=supersecrettoken
NAME=astroad NAME=astroad

View File

@ -29,6 +29,7 @@ jobs:
sed -i "s/MONGODB_URI=.*/MONGODB_URI=${{ secrets.MONGODB_URI }}/" .env sed -i "s/MONGODB_URI=.*/MONGODB_URI=${{ secrets.MONGODB_URI }}/" .env
sed -i "s/MONGODB_USER=.*/MONGODB_USER=${{ secrets.MONGODB_USER }}/" .env sed -i "s/MONGODB_USER=.*/MONGODB_USER=${{ secrets.MONGODB_USER }}/" .env
sed -i "s/MONGODB_PW=.*/MONGODB_PW=${{ secrets.MONGODB_PW }}/" .env sed -i "s/MONGODB_PW=.*/MONGODB_PW=${{ secrets.MONGODB_PW }}/" .env
sed -i "s/TOKEN=.*/TOKEN=${{ secrets.TOKEN }}/" .env
sed -i "s/NAME=.*/NAME=${{ vars.NAME }}/" .env sed -i "s/NAME=.*/NAME=${{ vars.NAME }}/" .env
cp .env ./astro/.env cp .env ./astro/.env
fi fi

View File

@ -13,6 +13,7 @@ const Posts: CollectionConfig = {
hooks: { hooks: {
afterChange: [ afterChange: [
async () => { async () => {
console.log("HALLO");
try { try {
console.log( console.log(
await fetch( await fetch(
@ -21,8 +22,7 @@ const Posts: CollectionConfig = {
method: "POST", method: "POST",
headers: { headers: {
Accept: "application/vnd.github.everest-preview+json", Accept: "application/vnd.github.everest-preview+json",
Authorization: Authorization: `token ${process.env.TOKEN}`,
"token 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",
}, },
body: JSON.stringify({ body: JSON.stringify({
event_type: "payload_update", event_type: "payload_update",