yihong0618 / running_page

Make your own running home page
https://running-page.vercel.app
MIT License
3.43k stars 992 forks source link

workflow run_data_sync --> Error: You have to provide a GITHUB_TOKEN or GH_PAT #489

Closed coolp4n closed 10 months ago

coolp4n commented 10 months ago

hi yihong 感谢您的项目 作为一个几年的跑者 第一次看到这个 觉得太酷辣! 目前遇到的问题是 当悦跑圈自动同步时的第二个workflow 会显示GitHub_token 不存在 但是单独跑publish github pages时 是可以的 不清楚是啥原因呢?? 我在secrets中有配置token ,变量名换成了ACCESS_TOKEN 我的repo是https://github.com/coolp4n/running_page/actions

yihong0618 commented 10 months ago

你需要配置个 ACCESS_TOKEN 在 secret 里

coolp4n commented 10 months ago

你需要配置个 ACCESS_TOKEN 在 secret 里

有配置 ACCESS_TOKEN 在 secret 的

yihong0618 commented 10 months ago

https://github.com/coolp4n/running_page/blob/059c5e9efb9910ab80c81730d0d5bbae876e0a11/.github/workflows/run_data_sync.yml#L191

在这下面也加上 env env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

coolp4n commented 10 months ago

https://github.com/coolp4n/running_page/blob/059c5e9efb9910ab80c81730d0d5bbae876e0a11/.github/workflows/run_data_sync.yml#L191

在这下面也加上 env env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

试了 还是不行

yihong0618 commented 10 months ago

@agassiyzh 我们看一下。

yihong0618 commented 10 months ago

also 我们这周会 merge 2.0 会改成 GitHub Actions 的方式

agassiyzh commented 10 months ago

@agassiyzh 我们看一下。

OK

agassiyzh commented 10 months ago

github项目里面GITHUB_TOKEN是默认就有的,不需要自己创建。你看一下Settings -> actions-> General里面 Workflow permissions有没有给写的权限

截屏2023-09-13 14 00 48
coolp4n commented 10 months ago

github项目里面GITHUB_TOKEN是默认就有的,不需要自己创建。你看一下Settings -> actions-> General里面 Workflow permissions有没有给写的权限

截屏2023-09-13 14 00 48

我使用的是ACCESS_TOKEN 变量名, 看了设置 是有写权限的 。单独跑publish github pages是可以的 但是在run_data_sync则会有这个报错 image

yihong0618 commented 10 months ago

@agassiyzh 这个问题好像挺常见,running_page 群里也有遇到的了

agassiyzh commented 10 months ago

github项目里面GITHUB_TOKEN是默认就有的,不需要自己创建。你看一下Settings -> actions-> General里面 Workflow permissions有没有给写的权限

截屏2023-09-13 14 00 48

我使用的是ACCESS_TOKEN 变量名, 看了设置 是有写权限的 。单独跑publish github pages是可以的 但是在run_data_sync则会有这个报错 image

我之前用ACCESS_TOKEN印象中也有问题。我直接用GITHUB_TOKEN了。

这是我的配置:

 - name: GitHub Pages
        uses: crazy-max/ghaction-github-pages@v3
        with:
          # Git branch where site will be deployed
          target_branch: gh-pages
          # Create incremental commit instead of doing push force
          keep_history: true
          # Build directory to deploy
          build_dir: public
          # Write the given domain name to the CNAME file
          #fqdn: custom.domain.name # optional
          # Prevent Jekyll from building the site
          jekyll: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

参考: https://docs.github.com/en/actions/security-guides/automatic-token-authentication

yihong0618 commented 10 months ago

we merge v2.0