Skip to content

Commit

Permalink
ci: do not persiste git credentials in GitHub Actions (#11640)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon authored Dec 9, 2024
1 parent 5bc8f81 commit b875079
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- uses: actions/checkout@v4
# Include all history and tags
with:
persist-credentials: false
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-python@v5
Expand All @@ -58,6 +59,8 @@ jobs:
image: python:3.9-alpine
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: source-dist
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_python_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
include: ${{steps.set-matrix.outputs.include}}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand Down Expand Up @@ -51,6 +53,7 @@ jobs:
- uses: actions/checkout@v4
# Include all history and tags
with:
persist-credentials: false
fetch-depth: 0

- uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v4
# Include all history and tags
with:
persist-credentials: false
fetch-depth: 0

# Ensure a new reno release note was added in this PR.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Get changed files
id: changed-files
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/django-overhead-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
path: ddtrace

- uses: actions/setup-python@v5
Expand All @@ -51,4 +52,3 @@ jobs:
with:
name: django-overhead-profile${{ matrix.suffix }}
path: ${{ github.workspace }}/prefix/artifacts

2 changes: 1 addition & 1 deletion .github/workflows/encoders-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
path: ddtrace

- uses: actions/setup-python@v5
Expand All @@ -43,4 +44,3 @@ jobs:
with:
name: encoders-profile
path: ${{ github.workspace }}/prefix/artifacts

2 changes: 1 addition & 1 deletion .github/workflows/flask-overhead-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
path: ddtrace

- uses: actions/setup-python@v5
Expand All @@ -39,4 +40,3 @@ jobs:
with:
name: flask-overhead-profile
path: ${{ github.workspace }}/prefix/artifacts

2 changes: 2 additions & 0 deletions .github/workflows/generate-package-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Python 3.7
uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v4
name: Install Node.js
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/requirements-locks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Fixup git permissions
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
extension: ["src/core"]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install latest stable toolchain and rustfmt
run: rustup update stable && rustup default stable && rustup component add rustfmt clippy
- name: Run cargo build
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/set-target-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v4
# Include all history and tags
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
Expand All @@ -32,7 +33,7 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const title = "${{ steps.milestones.outputs.milestone }}";
const title = "${{ steps.milestones.outputs.milestone }}"
const milestones = await github.rest.issues.listMilestones({
owner: context.repo.owner,
Expand All @@ -52,6 +53,6 @@ jobs:
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
issue_number: context.pull_request.number,
milestone: milestone.number,
});
6 changes: 6 additions & 0 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- name: Checkout system tests
uses: actions/checkout@v4
with:
persist-credentials: false
repository: 'DataDog/system-tests'

- name: Build agent
Expand Down Expand Up @@ -62,11 +63,13 @@ jobs:
- name: Checkout system tests
uses: actions/checkout@v4
with:
persist-credentials: false
repository: 'DataDog/system-tests'

- name: Checkout dd-trace-py
uses: actions/checkout@v4
with:
persist-credentials: false
path: 'binaries/dd-trace-py'
fetch-depth: 0
# NB this ref is necessary to keep the checkout out of detached HEAD state, which setuptools_scm requires for
Expand Down Expand Up @@ -112,6 +115,7 @@ jobs:
- name: Checkout system tests
uses: actions/checkout@v4
with:
persist-credentials: false
repository: 'DataDog/system-tests'

- name: Build runner
Expand Down Expand Up @@ -280,10 +284,12 @@ jobs:
- name: Checkout system tests
uses: actions/checkout@v4
with:
persist-credentials: false
repository: 'DataDog/system-tests'
- name: Checkout dd-trace-py
uses: actions/checkout@v4
with:
persist-credentials: false
path: 'binaries/dd-trace-py'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
Expand Down
Loading

0 comments on commit b875079

Please sign in to comment.