diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 443fba5964..9e2463d2a3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -6,6 +6,8 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + packages: read jobs: check: runs-on: ubuntu-latest @@ -30,7 +32,7 @@ jobs: - name: Setup .npmrc for GitHub Packages if: steps.files.outputs.any_changed == 'true' run: | - echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc echo "@iptv-org:registry=https://npm.pkg.github.com/" >> .npmrc echo "always-auth=true" >> .npmrc - name: Install dependencies diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9a96334b1a..cbd85a76cf 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -3,6 +3,8 @@ on: workflow_dispatch: # schedule: # - cron: "0 12 * * *" +permissions: + packages: read jobs: main: runs-on: ubuntu-latest @@ -24,7 +26,7 @@ jobs: cache: 'npm' - name: Setup .npmrc for GitHub Packages run: | - echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc echo "@iptv-org:registry=https://npm.pkg.github.com/" >> .npmrc echo "always-auth=true" >> .npmrc - name: Install dependencies diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index f4b4737ff8..48f7e2903d 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -3,6 +3,8 @@ on: workflow_dispatch: schedule: - cron: '0 0 * * *' +permissions: + packages: read jobs: main: runs-on: ubuntu-latest @@ -24,7 +26,7 @@ jobs: cache: 'npm' - name: Setup .npmrc for GitHub Packages run: | - echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc echo "@iptv-org:registry=https://npm.pkg.github.com/" >> .npmrc echo "always-auth=true" >> .npmrc - name: Install dependencies diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 925c5b8584..701e41e4d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -181,9 +181,9 @@ For scripts to work, you must have [Node.js](https://nodejs.org/en) installed on To run scripts use the `npm run ` command. -- `act:check`: allows to run the [check](https://github.com/iptv-org/iptv/blob/master/.github/workflows/check.yml) workflow locally. Depends on [nektos/act](https://github.com/nektos/act). -- `act:format`: allows to test the [format](https://github.com/iptv-org/iptv/blob/master/.github/workflows/update.yml) workflow locally. Depends on [nektos/act](https://github.com/nektos/act). -- `act:update`: allows to test the [update](https://github.com/iptv-org/iptv/blob/master/.github/workflows/update.yml) workflow locally. Depends on [nektos/act](https://github.com/nektos/act). +- `act:check`: allows to run the [check](https://github.com/iptv-org/iptv/blob/master/.github/workflows/check.yml) workflow locally. Depends on [nektos/gh-act](https://github.com/nektos/gh-act). +- `act:format`: allows to test the [format](https://github.com/iptv-org/iptv/blob/master/.github/workflows/update.yml) workflow locally. Depends on [nektos/gh-act](https://github.com/nektos/gh-act). +- `act:update`: allows to test the [update](https://github.com/iptv-org/iptv/blob/master/.github/workflows/update.yml) workflow locally. Depends on [nektos/gh-act](https://github.com/nektos/gh-act). - `api:load`: downloads the latest channel and stream data from the [iptv-org/api](https://github.com/iptv-org/api). - `api:generate`: generates a JSON file with all streams for the [iptv-org/api](https://github.com/iptv-org/api) repository. - `api:deploy`: allows to manually upload a JSON file created via `api:generate` to the [iptv-org/api](https://github.com/iptv-org/api) repository. To run the script you must provide your [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with write access to the repository. diff --git a/package.json b/package.json index bd6321be81..0358af08f8 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "iptv", "scripts": { - "act:check": "act pull_request -W .github/workflows/check.yml --secret-file .secrets", - "act:format": "act workflow_dispatch -W .github/workflows/format.yml --secret-file .secrets", - "act:update": "act workflow_dispatch -W .github/workflows/update.yml --secret-file .secrets", + "act:check": "gh act pull_request -W .github/workflows/check.yml", + "act:format": "gh act workflow_dispatch -W .github/workflows/format.yml", + "act:update": "gh act workflow_dispatch -W .github/workflows/update.yml", "api:load": "tsx scripts/commands/api/load.ts", "api:generate": "tsx scripts/commands/api/generate.ts", "api:deploy": "npx gh-pages-clean && npx gh-pages -a -m \"Deploy to iptv-org/api\" -d .api -r https://$GITHUB_TOKEN@github.com/iptv-org/api.git",