Skip to content

Commit

Permalink
Integrate update-new-members into deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vladh committed Aug 6, 2024
1 parent 566b94a commit 1cc459a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 39 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Deploy to GitHub Pages
name: Build, update members and deploy

on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
Expand All @@ -18,15 +14,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
- name: Checkout repository
uses: actions/checkout@v4
- name: Install, build, and upload your site
- name: Build website files
uses: withastro/action@v2
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

- name: Update new member files
run: bash ./bin/update-new-members ${{github.event.before}}
- name: Commit member changes, if any
run: bash ./bin/commit-member-changes
deploy:
needs: build
runs-on: ubuntu-latest
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/update-new-members.yml

This file was deleted.

7 changes: 6 additions & 1 deletion bin/update-new-members
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/bin/bash -eu
# USAGE: ./bin/update-new-members <sha_of_commit_to_check_since>
# This script fetches the JSON files specified for all members that have been
# added to `members.csv` compared to the `main` branch. Must be run in the
# repo's root.

if [ $# -eq 0 ]; then
echo "USAGE: ./bin/update-new-members <sha_of_commit_to_check_since>"
fi

new_member_lines=$(
diff \
--changed-group-format='%>' \
--unchanged-group-format='' \
<( git show main:members.csv ) \
<( git show $1:members.csv ) \
members.csv
) || true

Expand Down
2 changes: 1 addition & 1 deletion members.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sentry,https://raw.githubusercontent.com/opensourcepledge/osspledge.com/main/contrib/example-schema.json
test,https://raw.githubusercontent.com/opensourcepledge/osspledge.com/main/contrib/example-schema.json
newtest,https://raw.githubusercontent.com/opensourcepledge/osspledge.com/main/contrib/example-schema.json

0 comments on commit 1cc459a

Please sign in to comment.