GitHub 커밋 및 풀 리퀘스트에 스크린샷 추가 자동화
14558 단어 webdevactionshackathon21javascript
내 워크플로우
이 워크플로우는 퍼핏티어를 실행하고 웹 애플리케이션의 스크린샷을 캡처한 다음 스크린샷을 추가하여 댓글 또는 풀 요청 댓글을 커밋합니다. 이렇게 하면 웹 앱 UI 상태를 확인하는 프로세스가 쉬워집니다.
workflow file
제출 카테고리:
메인테이너 머스트해브
Yaml 파일
name: Browser-Testing
on: [push, pull_request]
jobs:
Browser-Testing:
runs-on: ubuntu-latest
# Service containers to run postgres
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
# install puppeteer dependency libraries using apt
- name: install puppeteer libraries
run: |
sudo apt-get update
sudo apt-get install -y libgbm1
# since puppeteer is large in size caching will reduce the runtime
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: "node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Install puppeteer
run: npm install puppeteer
- name: Migrate database
run: npm run prismamigrateprod
env:
NODE_ENV: production
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
- name: Seed database
run: npm run seed
env:
NODE_ENV: production
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
# run a bash script to start the server and then run puppeteer to capture the screenshots
# after capturing screenshots , they will be uploaded to cloudinary image service and pass the image url to next step using environment variables
- name: Run browser testing script
id: browser-testing
env:
HASHSALT: 123
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
run: |
chmod +x run-browser-testing.sh
./run-browser-testing.sh
# add comment to commit or pull request
- name: Add comment
uses: actions/github-script@v5
env:
SHA: ${{ github.sha }}
commentBody: ${{ env.commentBody }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let buffercommentBody = process.env.commentBody
let utf8commentBody = new Buffer.from(buffercommentBody, "base64").toString("utf8");
console.log(utf8commentBody);
github.rest.repos.createCommitComment({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: process.env.SHA,
body: utf8commentBody
})
주요 워크플로 단계는 다음과 같이 요약됩니다.
actions/github-script
작업createCommitComment
메서드를 사용하여 커밋 또는 끌어오기 요청에 대한 설명을 게시합니다. 추가 정보
에서 사용
리즈키 라지타 / 링크드인
Linkin은 사용자 지정 가능한 자체 호스팅 링크 트리 플랫폼입니다.
링크드인 ·
Linkin은 사용자 지정 가능한 자체 호스팅 링크 트리 응용 프로그램입니다.
무료 및 오픈 소스 💯
자체 호스팅, 귀하는 귀하의 데이터를 소유합니다 💽
기능이 풍부한 대시보드를 사용하여 몇 번의 클릭만으로 링크 트리를 사용자 지정하세요 🤖
Next js를 사용하여 구축된 SEO 친화적인 디자인 🕸️
여러 클라우드 공급자를 사용한 원클릭 배포 지원 🚀
View Demo
Demo Adminhttp://linkindemo.vercel.app/admin
admin
linkin123
Vercel로 배포
Heroku로 배포
철도와 함께 배포
시작하기
DATABASE_URL
- Postgres 데이터베이스 URLHASHSALT
- 임의의 비밀 키NODE_ENV
- NODE_ENV를 production
로 설정youdomain/admin
admin
linkin123
DATABASE_URL
- Postgres 데이터베이스 URLHASHSALT
- 임의의 비밀 키youdomain/admin
을 성공적으로 배포한 후…View on GitHub
Example commit comment
Reference
이 문제에 관하여(GitHub 커밋 및 풀 리퀘스트에 스크린샷 추가 자동화), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/rizkyrajitha/automate-adding-screenshots-to-github-commits-and-pull-requests-37gh텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)