This is a small utility action that clones a repository, using a ref linked from a pull request if possible.
For example:
jobs: sass-spec: name: Language Testsruns-on: ubuntu-lateststrategy: fail-fast: falsematrix: dart_channel: [stable, dev]async_label: [synchronous]async_args: ['']include: - dart_channel: stableasync_label: asynchronousasync_args: '--cmd-args --async'steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1with: {sdk: stable} - uses: actions/setup-node@v2with: {node-version: 16} - run: dart pub get - name: Check out sass-specuses: sass/clone-linked-repo@v1args: {repo: sass/sass-spec} - run: npm installworking-directory: sass-spec - name: Run specsrun: npm run sass-spec -- --dart .. $extra_argsworking-directory: sass-specenv: {extra_args: "${{matrix.async_args }}"}By default, this will clone sass-spec's main branch into the sass-spec path. But if a PR contains the text "sass/sass-spec#123" and there's a pull request with ID 123, it will clone pull/123/head instead.
This action is meant primarily for Sass repositories. Other repositories are welcome to use it, but please be aware that support will be a very low priority.
This will recognize both short references (
sass/sass-spec#123) and full URLs (https://github.com/sass/sass-spec/pulls/123).This will ignore references to issues and closed pull requests.
If the PR message contains multiple references to a PR from the same repository, this will use the first one.