Skip to content

Commit

Permalink
Add job to update versions on schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-izval committed Nov 14, 2023
1 parent 253e65a commit 25a27ff
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
- name: Checkout
uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v6
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: nixpkgs-terraform
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Update versions

on:
schedule:
- cron: "0 0 * * 0"

concurrency:
group: update-versions
cancel-in-progress: true

jobs:
check:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v6
- name: Install tools via Nix
run: nix develop --impure --check
- name: Update versions
run: nix develop --impure --command python3 update-versions.py vendor-hash.nix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
author: GitHub <[email protected]>
commit-message: Update Terraform versions
title: Update Terraform versions
body: |
Automatically created pull-request to update Terraform versions.
This is the result of running:
```
env GITHUB_TOKEN=<my-token> nix develop --impure --command python3 update-versions.py vendor-hash.nix
```
delete-branch: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# nixpkgs-terraform
All Terraform versions (>=1.5.0), kept up-to-date on a weekly basis using Nix. Heavily inspired by [cachix/nixpkgs-python](https://github.com/cachix/nixpkgs-python).

[![CI](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/ci.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/ci.yml)

0 comments on commit 25a27ff

Please sign in to comment.