0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

secrets.GITHUB_TOKEN と github.tokenで違いがあるのか

0
Last updated at Posted at 2025-07-06
name: Print Secrets
on: push
jobs:
  run:
    runs-on: ubuntu-latest
    env:
      SECRET1: ${{ secrets.GITHUB_TOKEN }}
      SECRET2: ${{ github.token }}
    steps:
      - run: echo "${SECRET1}"
      - run: echo "${SECRET1:0:1} ${SECRET1#?}"
      - run: echo "${SECRET2}"
      - run: echo "${SECRET2:0:1} ${SECRET2#?}"

github_actions.png

tokenの内容

tokenの内容には同じ値が入る。

注意点

メタ構文ではsecretsコンテキストにアクセスできない。
そのため、下記のような記述はできない。

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

メタ構文とは?

メタデータファイルで使われる書き方。

メタデータファイルとは?

アクションを実装するファイル。

  • 入出力インターフェイス
  • メインロジック
  • メインロジックへのエントリーポイント

などを書くことができる。

アクションとは?

ワークフロー内で実行される 処理の単位(再利用可能な機能ブロック)

アクションの実装方式

以下の3つの方式がある。

  1. Composite Action
  2. JavaScript Action
  3. Docker Container Action

メタデータファイル内のどこを見ればアクションの実装方式がわかる?

using に記載される。

runs:
  using: "composite"
  steps:
    - run: ${{ github.action_path }}/test/script.sh
      shell: bash

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?