Skip to content

Commit 79fa53a

Browse files
authored
Merge branch 'main' into no-error-with-networkerror
2 parents c95c9f7 + 148f171 commit 79fa53a

File tree

6 files changed

+196
-59
lines changed

6 files changed

+196
-59
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
812

913
permissions:
1014
contents: read
@@ -17,67 +21,63 @@ jobs:
1721
matrix:
1822
os: [ubuntu-latest, macos-latest, windows-latest]
1923
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
20-
2124
include:
2225
- os: ubuntu-latest
2326
python-version: "3.13"
2427
coverage: true
2528

2629
steps:
27-
- name: Harden the runner (Audit all outbound calls)
28-
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
29-
with:
30-
egress-policy: audit
31-
32-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
- name: Harden the runner (Audit all outbound calls)
31+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
32+
with:
33+
egress-policy: audit
3334

34-
- name: Set up Python
35-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
36-
with:
37-
python-version: ${{ matrix.python-version }}
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3836

39-
- name: Locate pip cache
40-
id: pip-cache
41-
shell: bash
42-
run: echo "dir=$(python -m pip cache dir)" >> "$GITHUB_OUTPUT"
37+
- name: Set up Python
38+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
cache: 'pip'
4342

44-
- name: Cache pip
45-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
46-
with:
47-
path: ${{ steps.pip-cache.outputs.dir }}
48-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
49-
restore-keys: ${{ runner.os }}-pip-
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
python -m pip install ".[dev,server]"
5047
51-
- name: Install dependencies
52-
run: |
53-
python -m pip install --upgrade pip
54-
python -m pip install ".[dev,server]"
48+
- name: Cache pytest results
49+
uses: actions/cache@v4
50+
with:
51+
path: .pytest_cache
52+
key: ${{ runner.os }}-pytest-${{ matrix.python-version }}-${{ hashFiles('**/pytest.ini') }}
53+
restore-keys: |
54+
${{ runner.os }}-pytest-${{ matrix.python-version }}-
5555
56-
- name: Run tests
57-
if: ${{ matrix.coverage != true }}
58-
run: pytest
56+
- name: Run tests
57+
if: ${{ matrix.coverage != true }}
58+
run: pytest
5959

60-
- name: Run tests and collect coverage
61-
if: ${{ matrix.coverage == true }}
62-
run: |
63-
pytest \
64-
--cov=gitingest \
65-
--cov=server \
66-
--cov-branch \
67-
--cov-report=xml \
68-
--cov-report=term
60+
- name: Run tests and collect coverage
61+
if: ${{ matrix.coverage == true }}
62+
run: |
63+
pytest \
64+
--cov=gitingest \
65+
--cov=server \
66+
--cov-branch \
67+
--cov-report=xml \
68+
--cov-report=term
6969
70-
- name: Upload coverage to Codecov
71-
if: ${{ matrix.coverage == true }}
72-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
73-
with:
74-
token: ${{ secrets.CODECOV_TOKEN }}
75-
files: coverage.xml
76-
flags: ${{ matrix.os }}-py${{ matrix.python-version }}
77-
name: codecov-${{ matrix.os }}-${{ matrix.python-version }}
78-
fail_ci_if_error: true
79-
verbose: true
70+
- name: Upload coverage to Codecov
71+
if: ${{ matrix.coverage == true }}
72+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
73+
with:
74+
token: ${{ secrets.CODECOV_TOKEN }}
75+
files: coverage.xml
76+
flags: ${{ matrix.os }}-py${{ matrix.python-version }}
77+
name: codecov-${{ matrix.os }}-${{ matrix.python-version }}
78+
fail_ci_if_error: true
79+
verbose: true
8080

81-
- name: Run pre-commit hooks
82-
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
83-
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
81+
- name: Run pre-commit hooks
82+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
83+
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build & Push Container
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '*'
9+
merge_group:
10+
pull_request:
11+
types: [labeled, synchronize, reopened, ready_for_review, opened]
12+
13+
env:
14+
PUSH_FROM_PR: >-
15+
${{ github.event_name == 'pull_request' &&
16+
(
17+
contains(github.event.pull_request.labels.*.name, 'push-container') ||
18+
contains(github.event.pull_request.labels.*.name, 'deploy-pr-temp-env')
19+
)
20+
}}
21+
22+
jobs:
23+
terraform:
24+
name: "ECR"
25+
runs-on: ubuntu-latest
26+
if: github.repository == 'coderamp-labs/gitingest'
27+
28+
permissions:
29+
id-token: write
30+
contents: read
31+
pull-requests: write
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: configure aws credentials
38+
uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
role-to-assume: ${{ secrets.CODERAMP_AWS_ECR_REGISTRY_PUSH_ROLE_ARN }}
41+
role-session-name: GitHub_to_AWS_via_FederatedOIDC
42+
aws-region: eu-west-1
43+
44+
- name: Set current timestamp
45+
id: vars
46+
run: |
47+
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
48+
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
49+
50+
- name: Login to Amazon ECR
51+
id: login-ecr
52+
uses: aws-actions/amazon-ecr-login@v2
53+
54+
- name: Docker Meta
55+
id: meta
56+
uses: docker/metadata-action@v5
57+
with:
58+
images: |
59+
${{ secrets.ECR_REGISTRY_URL }}
60+
flavor: |
61+
latest=false
62+
tags: |
63+
type=ref,event=branch,branch=main,suffix=-${{ steps.vars.outputs.sha_short }}-${{ steps.vars.outputs.timestamp }}
64+
type=ref,event=pr,suffix=-${{ steps.vars.outputs.sha_short }}-${{ steps.vars.outputs.timestamp }}
65+
type=pep440,pattern={{raw}}
66+
67+
- name: Set up QEMU
68+
uses: docker/setup-qemu-action@v3
69+
70+
- name: Set up Docker Buildx
71+
uses: docker/setup-buildx-action@v3
72+
73+
- name: Build and push
74+
uses: docker/build-push-action@v6
75+
with:
76+
context: .
77+
platforms: linux/amd64, linux/arm64
78+
push: ${{ github.event_name != 'pull_request' || env.PUSH_FROM_PR == 'true' }}
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
cache-from: type=gha
82+
cache-to: type=gha,mode=max

.github/workflows/docker_image.yml renamed to .github/workflows/docker-build.ghcr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ concurrency:
1717
env:
1818
REGISTRY: ghcr.io
1919
IMAGE_NAME: ${{ github.repository }}
20-
# Now allow pushing from PRs when either 'push-container' OR 'deploy-pr-temp-env' is present:
2120
PUSH_FROM_PR: >-
2221
${{ github.event_name == 'pull_request' &&
2322
(
@@ -31,6 +30,7 @@ permissions:
3130

3231
jobs:
3332
docker-build:
33+
name: "GHCR"
3434
runs-on: ubuntu-latest
3535
permissions:
3636
contents: read
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: PR Needs Rebase
2+
3+
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
permissions:
9+
pull-requests: write
10+
11+
jobs:
12+
label-rebase-needed:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'coderamp-labs/gitingest'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
steps:
21+
- name: Check for merge conflicts
22+
uses: eps1lon/actions-label-merge-conflict@v3
23+
with:
24+
dirtyLabel: 'rebase needed :construction:'
25+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
26+
commentOnClean: This pull request has resolved merge conflicts and is ready for review.
27+
commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged.
28+
retryMax: 30
29+
continueOnMissingPermissions: false

.github/workflows/stale.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Close stale issues and PRs"
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * *"
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v9
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
days-before-stale: 45
20+
days-before-close: 10
21+
stale-issue-label: stale
22+
stale-pr-label: stale
23+
stale-issue-message: |
24+
Hi there! We haven’t seen activity here for 45 days, so I’m marking this issue as stale.
25+
If you’d like to keep it open, please leave a comment within 10 days. Thanks!
26+
stale-pr-message: |
27+
Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale.
28+
If you’d like to keep it open, please leave a comment within 10 days. Thanks!
29+
close-issue-message: |
30+
Hi there! We haven’t heard anything for 10 days, so I’m closing this issue. Feel free to reopen if you’d like to continue the discussion. Thanks!
31+
close-pr-message: |
32+
Hi there! We haven’t heard anything for 10 days, so I’m closing this pull request. Feel free to reopen if you’d like to continue working on it. Thanks!

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
## [0.2.0](https://github.com/coderamp-labs/gitingest/compare/v0.1.5...v0.2.0) (2025-07-26)
44

5-
6-
### ⚠ BREAKING CHANGES
7-
8-
*
9-
*
10-
115
### Features
126

137
* `include_submodules` option ([#313](https://github.com/coderamp-labs/gitingest/issues/313)) ([38c2317](https://github.com/coderamp-labs/gitingest/commit/38c23171a14556a2cdd05c0af8219f4dc789defd))

0 commit comments

Comments
 (0)