Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .github/workflows/build-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@ name: Build dist

on:
push:
branches:
- main
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

node-version: '24.x'
- run: npm install
- run: npm run build
- name: Push dist to main-dist branch
run: |
git config user.name "github-actions[bot]"
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24.x'
- run: npm install
- run: npm run build
- run: npm test
16 changes: 0 additions & 16 deletions .github/workflows/jest-tests.yml

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ name: Prettier

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

permissions:
contents: write

jobs:
prettier:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Prettify code
uses: creyD/prettier_action@v3.3
uses: creyD/prettier_action@31355f8eef017f8aeba2e0bc09d8502b13dbbad1 # v4.3
with:
prettier_options: --write **/*.{js,md}
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ on:
release:
types: [created]

permissions:
contents: write
id-token: write

jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '12.x'
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
updateDocs:
runs-on: ubuntu-20.04
if: success()
runs-on: ubuntu-24.04
needs: publish
steps:
- name: Call update docs
env:
Expand All @@ -28,4 +30,3 @@ jobs:
WORKFLOW_ID: 90722302
run: |
curl -fL --retry 3 -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.TOKEN }}" https://api.github.com/repos/${{ env.REPO }}/actions/workflows/${{ env.WORKFLOW_ID }}/dispatches -d '{"ref":"main", "inputs": {}}'

6 changes: 3 additions & 3 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@

jobs:
update-docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: 'authentication'
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '24.x'
- name: Clone docs
run: |
cd $GITHUB_WORKSPACE/
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git clone https://x-access-token:${{ secrets.TOKEN }}@github.com/elfsquad/docs.git
- name: Update docs
run: |
npm i -g @elfsquad/tsdoc-parser
tsdoc-parser $GITHUB_WORKSPACE/authentication/src/authentication/authenticationContext.ts authenticationContext.json AuthenticationContext

file="$GITHUB_WORKSPACE/docs/docs/configurator/libraries/methods/authenticationContext.ts"
echo "export default $(cat authenticationContext.json)" > temp && mv temp $file

cd $GITHUB_WORKSPACE/docs
git checkout -b update-authentication-context-docs
git add .
git commit -m "Update documentation for authentication context"
git push --set-upstream origin update-authentication-context-docs -f
gh pr create --title "Update Authentication Context Documentation" \
--body "This PR updates the documentation for the Authentication Context based on the latest changes."
env:
GH_TOKEN: ${{ secrets.TOKEN }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ const authenticationContext = new AuthenticationContext({
method: "POST",
body: JSON.stringify({ token }),
}).then(() => {}),
refreshAccessToken: () =>
fetch("/auth/refresh").then((r) => r.json()),
refreshAccessToken: () => fetch("/auth/refresh").then((r) => r.json()),
revokeRefreshToken: () =>
fetch("/auth/revoke", { method: "POST" }).then(() => {}),
});
Expand Down
Loading