簡體   English   中英

Github 操作運行 - 但預期 output 在 repo 中不可見

[英]Github action runs - but expected output not visible in repo

我最近嘗試實施一個 Github 操作,該操作應每天運行並將文件保存到存儲庫中的文件夾中。

此 Github 操作的作業運行時沒有錯誤,但文件夾和文件均未顯示在我的存儲庫中。

您可以在此處找到 yml 文件:

https://github.com/analphabit/github_actions/blob/main/.github/workflows/save_rki_impfmonitoring_excel.yml

name: Save RKI-Excel file Impfmonitoring

on: [push] 
  #schedule:
  #  - cron: '0 0 * * *'

jobs:
  save-excel:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Create Directory
      run: |
        mkdir -p data
    - name: Download Excel File
      run: |
        python -c "from urllib.request import urlretrieve; urlretrieve('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile', 'data/data.xlsx')"
    - name: Save Excel File
      run: |
        mv data/data.xlsx data/$(date +"%Y-%m-%d")-data.xlsx

這個想法是它每天下載 xlsx 文件並將其與文件名中的時間戳一起存儲在 repo“github_actions”中名為“data”的目錄中。

該操作運行無誤,但目錄和文件不顯示在那里。

https://github.com/analphabit/github_actions/actions/runs/3700392300

我在這里錯過了什么?

謝謝巴圖比

確保git addgit commitgit push

這是我在pwsh步驟中的工作流程中所做的:

& git config --local user.email "jesse.houwing@gmail.com"
& git config --local user.name "Jesse Houwing"
& git add .
& git diff HEAD --exit-code | Out-Null
if ($LASTEXITCODE -ne 0)
{    
    & git commit -m "Regenerating renovate-data.json"
    & git push
}

這只是在虛擬機中創建一個文件。 您還需要提交並推送新的更改。 例如,通過使用Git 自動提交操作:

name: Save RKI-Excel file Impfmonitoring

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  save-excel:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Create Directory
        run: |
          mkdir -p data
      - name: Download Excel File
        run: |
          python -c "from urllib.request import urlretrieve; urlretrieve('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile', 'data/data.xlsx')"
      - name: Save Excel File
        run: |
          mv data/data.xlsx data/$(date +"%Y-%m-%d")-data.xlsx

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: main
          file_pattern: '*.xlsx'

要閱讀有關 GH Actions 跑步者的更多信息,請訪問跑步者部分。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM