Loyalsoldier / v2ray-rules-dat

🦄 🎃 👻 V2Ray 路由规则文件加强版,可代替 V2Ray 官方 geoip.dat 和 geosite.dat,适用于 V2Ray、Xray-core、mihomo(Clash-Meta)、hysteria、Trojan-Go 和 leaf。Enhanced edition of V2Ray rules dat files, applicable to V2Ray, Xray-core, mihomo(Clash-Meta), hysteria, Trojan-Go and leaf.
GNU General Public License v3.0
15.27k stars 1.86k forks source link

[建议]使用sha256检测上游是否更新来判断是否需要发布新release #313

Closed chise0713 closed 1 year ago

chise0713 commented 1 year ago

我认为如果上游并没有更新的话再发布一个新release是没有必要的,所以有了这个想法。

简短的代码示意:

curl -oL ./ https://github.com/Loyalsoldier/v2ray-rules-dat/blob/release/geosite.dat.sha256sum?raw=true
if diff -q "geosite.dat.sha256sum" "publish/geosite.dat.sha256sum"; then
  echo "upstream_status=updated" >> $GITHUB_ENV
else
  echo "upstream_status=not_updated" >>$GITHUB_ENV
fi

然后在workflow中添加判断:

      - name: Do something if upstream is updated
        if: ${{ env.upstream_status }} == 'not_updated'
        run: |
          echo "Upstream is not updated, performing additional actions..."

这样就能减少release的发布了。

Loyalsoldier commented 1 year ago

现在上游项目 https://github.com/Loyalsoldier/domain-list-custom 即使域名没增减,每次生成的文件都不一样,等待重构吧