Skip to content

GitHub Actions CI triggered by PRs by others fails #164

Open
@tats-u

Description

@tats-u

Encrypted secrets in GitHub Actions are not passed to builds triggered by forked repositories (PRs from others).
https://docs.github.com/ja/free-pro-team@latest/actions/reference/encrypted-secrets#%E6%9A%97%E5%8F%B7%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%82%B7%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88%E3%81%AE%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E5%86%85%E3%81%A7%E3%81%AE%E5%88%A9%E7%94%A8 (Japanese)
This makes Connect to github.com and Connect to github.com with name and config for PRs fail.

Take /.github/workflows/verify-on-ubuntu-2004.yml as an example.

name: Connect to github.com
runs-on: ubuntu-20.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

In this configuration, key and known_hosts are ignored in PRs (except for yours). Options passed to builds for my PR are:

Run ./.
  with:
    name: id_rsa
Error: Input required and not supplied: key

name: id_rsa is the default option, so you can see those 2 options are missing.

It may be fixed by changing the SSH target to one created by Docker (you do not have to apply it to builds for develop branch).


Image candidate: https://github.com/linuxserver/docker-openssh-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions