Skip to content

CI Add New Palette #1231

CI Add New Palette

CI Add New Palette #1231

Workflow file for this run

name: CI Add New Palette
on:
push:
branches:
- main
schedule:
- cron: '0 7/1 * * *'
workflow_dispatch:
inputs:
name:
description: 'Why'
required: false
default: 'Because I want to check if there are new records'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current repo
uses: actions/checkout@v2
- name: Get current directory and files
run: |
pwd
ls
- uses: actions/setup-python@v1
with:
python-version: '3.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install Python Requirements
run: |
python --version
pip install -r automation/requirements.txt
- name: Download Records
run: |
python automation/add_new_entries.py --token ${{ secrets.NETLIFY_TOKEN }} --netlify_form_id ${{ secrets.NETLIFY_FORM_ID }}
ls content/colors/
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git pull
git status
git add automation/add_new_entries.history
git commit -m "update pr history" || echo "Nothing to update"
git push
git add .
commit_message=$(git diff --name-only --staged | tail -1)
# echo "COMPANY_NAME=$(cat $commit_message | grep name)" >> $GITHUB_ENV
# echo "COMPANY_BODY=$(cat $commit_message)" >> $GITHUB_ENV
git commit -m "new palette" || echo "Nothing to update"
git status
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
title: New Palette Request
body: "A new palette has been requested. Check the files changed to see the details."
token: ${{ secrets.GITHUB_TOKEN }}
branch-suffix: short-commit-hash
- name: Check PR outputs
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"