LoginSignup
3
0

More than 3 years have passed since last update.

Github actionsでタグを取得する方法

Posted at

前談

github actionsのcheckoutの仕様変更で、 unshallowしないと履歴が取れなくなりました。
なので、最新の情報だけではなく過去の履歴が欲しい場合はこうします。

on:
  push:
    branches:
      - master
jobs:
  versioning:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Unshallow
        run: git fetch --prune --unshallow

今回の話

tagの一覧もほしい場合は先程のでは取れません。欲しい場合は、オプションでunshallowと一緒にtagsもつけてあげます。

2020年の3月か4月ぐらいまではオプション追加しなくてもきちんと動いてたんだけど、gitのバージョンの問題か、checountの変更かわかりませんが、取れなくなりました。

on:
  push:
    branches:
      - master
jobs:
  versioning:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Unshallow
        run: git fetch --prune --unshallow --tags

Appendix

同じところではハマった人のissue... かなしい...
https://github.com/actions/checkout/issues/206

3
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0