Fix .tool-versions from workspace root #530
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test HTTP Credentials | |
on: | |
- pull_request | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
git_http_full_path_credentials: | |
runs-on: ubuntu-latest | |
name: git+http full path creds | |
env: | |
TERRAFORM_HTTP_CREDENTIALS: | | |
github.com/dflook/hello=dflook:notapassword | |
github.com/hello=dflook:stillnotapassword | |
github.com/dflook/terraform-github-actions-dev.git=dflook:${{ secrets.USER_GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Apply | |
uses: ./terraform-apply | |
id: output | |
with: | |
path: tests/workflows/test-http | |
auto_approve: true | |
- name: Verify outputs | |
run: | | |
if [[ "${{ steps.output.outputs.git_https }}" != "hello" ]]; then | |
echo "::error:: output not set correctly" | |
exit 1 | |
fi | |
git_http_partial_path_credentials: | |
runs-on: ubuntu-latest | |
name: git+http partial path creds | |
env: | |
TERRAFORM_HTTP_CREDENTIALS: | | |
github.com/dflook/hello=dflook:notapassword | |
github.com/hello=dflook:stillnotapassword | |
github.com/dflook=dflook:${{ secrets.USER_GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Apply | |
uses: ./terraform-apply | |
id: output | |
with: | |
path: tests/workflows/test-http | |
auto_approve: true | |
- name: Verify outputs | |
run: | | |
if [[ "${{ steps.output.outputs.git_https }}" != "hello" ]]; then | |
echo "::error:: output not set correctly" | |
exit 1 | |
fi | |
git_http_no_path_credentials: | |
runs-on: ubuntu-latest | |
name: git+http no path | |
env: | |
TERRAFORM_HTTP_CREDENTIALS: | | |
github.com/dflook/hello=dflook:notapassword | |
github.com/hello=dflook:stillnotapassword | |
github.com=dflook:${{ secrets.USER_GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Apply | |
uses: ./terraform-apply | |
id: output | |
with: | |
path: tests/workflows/test-http | |
auto_approve: true | |
- name: Verify outputs | |
run: | | |
if [[ "${{ steps.output.outputs.git_https }}" != "hello" ]]; then | |
echo "::error:: output not set correctly" | |
exit 1 | |
fi | |
git_no_credentials: | |
runs-on: ubuntu-latest | |
name: git+http no creds | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Apply | |
uses: ./terraform-apply | |
continue-on-error: true | |
id: apply | |
with: | |
path: tests/workflows/test-http | |
auto_approve: true | |
- name: Check failed | |
run: | | |
if [[ "${{ steps.apply.outcome }}" != "failure" ]]; then | |
echo "did not fail correctly with no http credentials" | |
exit 1 | |
fi | |
http_credentials: | |
runs-on: ubuntu-latest | |
name: http module source | |
env: | |
TERRAFORM_HTTP_CREDENTIALS: | | |
5qcb7mjppk.execute-api.eu-west-2.amazonaws.com=dflook:hello | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create dummy credential file | |
run: | | |
mkdir -p ${{ runner.temp }}/_github_home | |
cp tests/workflows/test-http/http-module/netrc ${{ runner.temp }}/_github_home/.netrc | |
ls -la ${{ runner.temp }} | |
- name: Apply | |
uses: ./terraform-apply | |
id: output | |
with: | |
path: tests/workflows/test-http/http-module | |
auto_approve: true | |
- name: Verify outputs | |
run: | | |
if [[ "${{ steps.output.outputs.https }}" != "hello" ]]; then | |
echo "::error:: output not set correctly" | |
exit 1 | |
fi | |
# Check the credential file is as before | |
diff tests/workflows/test-http/http-module/netrc ${{ runner.temp }}/_github_home/.netrc | |
http_no_credentials: | |
runs-on: ubuntu-latest | |
name: http module source with no credentials | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Apply | |
uses: ./terraform-apply | |
continue-on-error: true | |
id: apply | |
with: | |
path: tests/workflows/test-http/http-module | |
auto_approve: true | |
- name: Check failed | |
run: | | |
if [[ "${{ steps.apply.outcome }}" != "failure" ]]; then | |
echo "did not fail correctly with no http credentials" | |
exit 1 | |
fi |